Please follow the steps below to learn how authentication works in Express:
- Visit www.passport.org and sign up for an account, then select "local".
- Open VS Code and open a new terminal.
- Write the following commands:
npm init
npm i express express-session passport
- Press "enter" after each command.
- Open MongoDB Compass and navigate to the local folder.
- Click on "+", then select "new database".
- In the VS Code terminal, write the command
npm i mongoose
. - After connecting with MongoDB, write the command
npm run dev
in the terminal.