REST-API built using Node.js, Express.js, MongoDB and JWT. The API follows CRUD methods. It is the backed server for my Memories-Book application
- Create .env file as below
PORT=5000
DB_CONNECTION=mongodb+srv://<username>:<password>@<cluster_name>.mongodb.net/
TOKEN_SECRET=<your_secret> // generate it using the command : node -e "console.log(require('crypto').randomBytes(64).toString('hex'));"
POST /api/auth/register
- Register a new userPOST /api/auth/login
- Login a user
GET /api/users/:id
- Get user profile by IDPUT /api/users/:id
- Update user profileDELETE /api/users/:id
- Delete user profile
POST /api/posts
- Create a new postGET /api/posts/:id
- Get post by IDPUT /api/posts/:id
- Update postDELETE /api/posts/:id
- Delete post