A Login Backend using NodeJS and MongoDB.
Verifies each input using express-validator. Passwords are hashed and salted using bcryptjs. JWT is used to create a token for each user.
- express
- mongoose
- bcryptjs
- cors
- express-validator
- jsonwebtoken
- nodemon
- Install Login with npm
npm install Login
cd Login
- Install MongoDB to local machine.
- Open terminal and start the mongo server
mongod
- Create a database login and a table called users will be created.
- Start the backend server using the command
npm i
nodemon index.js
- APIs
http://localhost:5000/api/auth/signin
http://localhost:5000/api/auth/login
http://localhost:5000/api/auth/getuser