- Implementing user authentication in an express app.
- Authentication done using
jwt (json web token)
. Passwords are hashed usingbcrypt
. The API uses a MongoDB database.
URL | METHOD | DESCRIPTION |
---|---|---|
api/users/ | POST (public) | register a user |
api/users/login | POST (public) | logs in a user |
api/users/me | GET (private) | gets the info of the logged in user |
- Clone the repository on your local computer
- Do
npm run install
to install the required dependencies - Set up your MongoDB collection
- Do
npm run dev
to start the API
Test the API with Postman