🖐 Hi there, here I've built a node.js + express.js + mongodb RESTfull API along with JWT authentication. Here I've took book database as an example for make CRUD operations via API calls with JWT authentication. Please go through the screenshots to know more about endpoints. Feel free to use this code and work around it. Hope you got the insights!
- bcryptjs - Password hashing
- jsonwebtoken - for generating JWT
- express-validator - Input validation
- mongodb - mongodb cluster
- mongoose - ODM
- express - node.js framework
http://localhost:3000/auth
http://localhost:3000/get
http://localhost:3000/get/61783fccf74ebca4a95922a3
http://localhost:3000/post
http://localhost:3000/put
http://localhost:3000/delete
- Well, first clone or download this repo.
- Create a cluster in mongodb Atlas, and then create a collection, and get your access URL to your cluster's database and paste it in app.js for MONGODBURL variable.
- Run "npm install" to install dependent packages for the app.
- Now, you're ready to go!
Please give me a star⭐ to this repo, I'll be happy😊.