This is a small API that implements user authentication with the help of...
- Express: handles routes and requests
- Mongoose: handles all things mongodb
- Bcrypt: used to hash the passwords before being saved into the database
- Express-session: used to keep a session for each user that successfully logs in
- Uniqid: generates unique ids for the sessions
- Helmet: provides some nice protection for the API
Notes
- I am using the
import .. from ...
syntax instead of therequire(...)
because I addedesm
to the dependencies and the scripts in thepackage.json
file have been set to require this module when executing the script. - I also don't require
dotenv/config
explicitly since I am already requiring in thestart
anddev
scripts inside thepackage.json
file.