This is a todo application with cookie authentication. JWT is used for token generation and the cookie is used in the server side to ensure the api's are kept secure. For the todo app, CRUD operations were performed while ensuring only the logged in user is able to do those operations. Error handling is also ensured.
POST /api/v1/users/register
Request Body | Type | Description |
---|---|---|
name | string |
Required |
string |
Required | |
password | string |
Required |
POST /api/v1/users/login
Request Body | Type | Description |
---|---|---|
string |
Required | |
password | string |
Required |
GET /api/v1/users/user,
POST /api/v1/users/logout
POST /api/v1/tasks/create
Request Body | Type | Description |
---|---|---|
title | string |
Required |
body | string |
Required |
GET /api/v1/tasks/all
POST /api/v1/tasks/:id
param | Type | Description |
---|---|---|
id | string |
Required |
POST /api/v1/tasks/:id
param | Type | Description |
---|---|---|
id | string |
Required |
parameter | description |
---|---|
PORT | port number |
MONGO_URI | Mongodb Atlas URI |
DB_NAME | Mongodb database name |
JWT_SECRET | JWT secret string |
NODE_ENV | set this to be 'production' or 'development' |
FRONT_END_URL | your frontend applications domain url |