File tree Expand file tree Collapse file tree 5 files changed +16
-13
lines changed Expand file tree Collapse file tree 5 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " koa-vue-notes-api" ,
3- "version" : " 1.2.3 " ,
3+ "version" : " 1.2.4 " ,
44 "description" : " A SPA using Koa as the backend and Vue as the frontend." ,
55 "author" : " John Datserakis" ,
66 "private" : false ,
Original file line number Diff line number Diff line change @@ -56,24 +56,26 @@ npm run pretty
5656# run tests
5757npm run test
5858
59- # knex migration examples
60- # (from command line in root directory with knex installed globally)
61- # (*make* commands are just here to show syntax)
62-
63- # make migration
64- knex migrate:make create_users_table
59+ # # knex migrations ##
6560
6661# migrate latest
6762knex migrate:latest
6863
6964# rollback
7065knex migrate:rollback
7166
67+ # run all seeds
68+ knex seed:run
69+
70+ # # knex seed and migration make commands ##
71+
72+ # make migration
73+ knex migrate:make create_users_table
74+
7275# make seed
7376knex seed:make seed_users
7477
75- # run all seeds
76- knex seed:run
78+
7779```
7880
7981## General Information
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class UserController {
101101
102102 //Let's grab their ipaddress
103103 //TODO: This doesn't work correctly because of the reverse-proxy
104- request . ipAddress = ctx . request . ip
104+ request . ipAddress = ctx . ip
105105
106106 //Ok, at this point we can sign them up.
107107 try {
@@ -179,7 +179,7 @@ class UserController {
179179 ctx . userAgent . platform +
180180 ' ' +
181181 ctx . userAgent . browser ,
182- ipAddress : ctx . request . ip ,
182+ ipAddress : ctx . ip ,
183183 expiration : dateAddMonths ( new Date ( ) , 1 ) ,
184184 }
185185
@@ -268,7 +268,7 @@ class UserController {
268268 ctx . userAgent . platform +
269269 ' ' +
270270 ctx . userAgent . browser ,
271- ipAddress : ctx . request . ip ,
271+ ipAddress : ctx . ip ,
272272 expiration : dateAddMonths ( new Date ( ) , 1 ) ,
273273 }
274274
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ const router = new Router()
88const jwtMiddleware = jwt ( { secret : process . env . JWT_SECRET } )
99
1010router . get ( '/' , async ( ctx , next ) => {
11- ctx . body = { message : 'Hi there.' }
11+ console . log ( ctx . request . ip )
12+ ctx . body = { message : 'Hi there.' , ctx : ctx . request . ip }
1213} )
1314
1415//Initial controller once for all routes
You can’t perform that action at this time.
0 commit comments