You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
## v7.1.0 (July 25, 2019)
2
+
3
+
- Postman Collection example now included in root directory. Now /login has a test that automatically gets ans sets token. Thank you Glen! ([#92](https://github.com/davellanedam/node-express-mongodb-jwt-rest-api-skeleton/pull/92))
Copy file name to clipboardExpand all lines: README.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,15 +199,12 @@ Once everything is set up to test API routes either use Postman or any other api
199
199
200
200
### Postman API example collection
201
201
202
-
You can import the example collection to Postman
202
+
You can import the example collection to Postman. To import, click the import button located and select `postman-example.json` located within the root directory.
Go to `manage environments` to create environments for development, production, etc. On each of the environments you create you will need to:
205
205
206
-
If you use Postman please go to `manage environments` and then create one for each of your servers (Ex. myApi-LOCAL, myApi-PRODUCTION).
206
+
1. Create a new key `authToken` and within the `/login` request this value is automatically updated after a successfull login through a script located in the `tests` tab. Each time you make a request to the API it will send `Authorization` header with the `token` value in the request, you can check this on the headers of users or cities endpoints in the Postman example.
207
207
208
-
On each of the environments you create you will need to:
209
-
210
-
1. Create a new key `authToken` with `token` value (the token you got from the login process), each time you make a request to the API it will send `Authorization` header with the token value in the request, you can check this on the headers of users or cities endpoints in the Postman example.
211
208
2. Create a second key `server` with the url of your server, for development mode use <http://localhost:3000>
212
209
213
210
This is a REST API, so it works using the following HTTP methods:
@@ -227,7 +224,7 @@ If you need to add more routes to the project just create a new file in `/app/ro
227
224
228
225
### Creating new controllers
229
226
230
-
When you create a new controller file, try to also create another file with validations. Ex. `countries.js``countries.validate.js` An example of this is included in the repository.
227
+
When you create a new controller file, try to also create another file with validations. Ex. `countries.js`and `countries.validate.js`. An example of this is included in the repository.
0 commit comments