NodeJS, ExpressJS and MongoDB RESTful API with JWT authentication.
- User authentication with JWT.
- User can perform CRUD operations on Todo List
- API uses Accept header to accept authentication JWT token
git clone https://github.com/akinmaurice/todo-API.gitcd todo-APInpm install- set up env variables
npm start
The above will get you a copy of the project up and running on your local machine for development and testing purposes.
- [MongoDB]
- [NodeJS]
- [ExpressJS]
Most endpoints require a token for authentication. The API call should have the token in Authorization header.
authorization: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE0Njc2MTkxNDV9.R6VLZD4qtsdVHXZwU8bEo6S16cbNQfo7lICsNdAq00I"
| EndPoint | Functionality |
|---|---|
| POST /user/register | Signup a user |
| POST /user/login | Login user |
| POST /todo/createTodo | Create a new todo |
| GET /todos/ | List all todos |
| GET /todo/:slug | Get single todo |
| PUT /todo/:id | Update this todo |
| DELETE /todo/:id | Delete this single todo |
| POST /todo/add/:id | Create Todo Activity |
| DELETE /todo/delete/:id | Delete Activity from Todo |
The API responds with JSON data by default.
The API responds with an error message and http status code whenenever it encounters an error.
{
"status": "404",
"message": "Something Went Wrong"
}
This project is licensed under the MIT License - see the LICENSE.md file for details