- public
- temp
- command = touch app.js constants.js index.js
- type:module
- "dev": "nodemon -r dotenv/config --experimental-json-modules ./scr/index.js"
- npm i -D nodemon
- mkdir scr/controller, scr/controller, scr/db, scr/middleware, scr/route, scr/models, scr/utils, public/temp
- controllers
- db
- middleware
- models
- routes
- utils
- npm i -D prettier
- create file in main directory [1] .prettierrc [2] .prettierignore
- app.use(cors{})
- app.use(express.json())
- app.use(express.urlencoded({ extended: true }));
- override the error
- [A] Apiresponse = constructor create
- [B] asyncHandler = constructor create
- [A] user.model.js = userSchema
- [B] video.model.js = videoSchema
- [A] pre hooks Setup = isModified
- [B] userSchema.methods.isPasswordCorrect
- [C] userSchema.methods.generateAccessToken
- [D] userSchema.methods.generateRefreshToken