This is simple way how to implement JWT Token based auth using express, mongoose and JWT. There are following endpoints:
/auth/sign-up POST
/auth/sign-in POST
/users GET
/users/id GET
/users/id DELETE 🔒
/users/id PUT 🔒
/posts GET 🔒
/posts POST 🔒
/posts/id GET 🔒
/posts/id DELETE 🔒
/posts/id PUT 🔒
each user have its own posts, therefor each post have one user who created this post.
- git clone https://github.com/Datodia/express-auth.git
- npm i
- add your .env files
- npm run start