@@ -53,6 +53,12 @@ Start server in development mode
53
53
npm run start: dev
54
54
```
55
55
56
+ ## Running the tests
57
+ Run the unit and integration tests using the command
58
+ ``` node
59
+ npm test
60
+ ```
61
+
56
62
## Built With
57
63
58
64
* [ Express] ( https://expressjs.com/ ) - Express
@@ -62,32 +68,40 @@ npm run start:dev
62
68
63
69
## API Endpoints
64
70
65
- versioning for the endpoints
66
- /api/
71
+ ### Versioning for the none auth endpoints
72
+ * ` /api/ `
73
+
74
+ * Use ` http://127.0.0.1:8001 ` as the base URL for the endpoints
67
75
68
76
## API Documentation
69
77
[ Postman API Documentation] ( https://documenter.getpostman.com/view/6831940/SVYtNdfm )
70
78
71
- | Method | Route |
72
- | ------------- | ------------- |
73
- | POST | http://127.0.0.1:8001/auth/signup |
74
- | POST | http://127.0.0.1:8001/auth/login |
75
- | GET | http://127.0.0.1:8001/api/todos |
76
- | POST | http://127.0.0.1:8001/api/todos |
77
- | GET | http://127.0.0.1:8001/api/todos/1 |
78
- | PUT | http://127.0.0.1:8001/api/todos/1 |
79
- | DELETE | http://127.0.0.1:8001/api/todos/1 |
80
- | POST | http://127.0.0.1:8001/api/todos/1 |
81
- | PUT | http://127.0.0.1:8001/api/todos/1/items/2 |
82
- | DELETE | http://127.0.0.1:8001/api/todos/1/items/2 |
83
-
84
- ### Hosted on Heroku
79
+
80
+ | Method | Description| Route |
81
+ | ------------- | ------------- | ------------- |
82
+ | POST | Sign up | ` /auth/signup ` |
83
+ | POST | Log in | ` /auth/login ` |
84
+ | PATCH | Update password | ` /api/users/:userId ` |
85
+ | GET | Get all todos | ` /api/todos ` |
86
+ | POST | Create a todo | ` /api/todos ` |
87
+ | GET | Get a specific todo | ` /api/todos/:todoId ` |
88
+ | PUT | Update a specific todo | ` /api/todos/:todoId ` |
89
+ | DELETE | Delete a specific todo | ` /api/todos/:todoId ` |
90
+ | POST | Create a todo item | ` /api/todos/:todoId/items ` |
91
+ | PUT | Update a todo item | ` /api/todos/:todoId/items/:todoItemId ` |
92
+ | DELETE | Delete a todo item | ` /api/todos/:todoId/items/:todoItemId ` |
93
+
94
+ ## Hosted on Heroku
85
95
[ Heroku Link] ( https://todos-node-app.herokuapp.com/ )
86
96
87
- ### Notes
97
+ ## Notes
88
98
89
99
All routes apart from ` auth/login ` and ` auth/signup ` require Authorization using a JSON Web Token
90
100
101
+ Add an authorization header with the token
102
+
103
+ ` 'Authorization': 'Bearer token' `
104
+
91
105
## Author
92
106
93
107
* ** Ryan Simiyu**
0 commit comments