node -v 21.4.0 express@4.18.2 npm install -D nodemon@3.0.2

npm run start:dev

http://localhost:3000/api/users?filter=username&value=al

install thunder client in VS Code. It works just like Postman.

PATCH #change some fields of the record in database PUT #replace all fields of the record in database

npm i express npm i express-validator

npm i express-session npm i cookie-parser npm i mongoose

npm i bcrypt

(npm i npm-check-updates)

npm i connect-mongo


OAuth2

discord.com --> developer --> application --> OAuth2 --> reset secret

clientID: 1247722845836935168 clientSecret: y5h1-sW4kJOGvmxCPUmnT41ORTkeG0Zw callbackURL: http://localhost:3000/api/auth/discord/redirect

Generated URL for identify scope:

https://discord.com/oauth2/authorize?client_id=1247722845836935168&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fauth%2Fdiscord%2Fredirect&scope=identify

npm i passport

npm i passport-discord passport #if you do not have a passport installed already.