Category: Node Js, Express and Mongoose
-

Create Models Step-6
Step 6: -Create Models Crete a new folder with name models Create a new file inside folder route with any name like teamMember.js
-

Setup database MongoDB – Step 5
Step 5: – Setup database MongoDB Mongodb.com Login Create cluster Database access Network access Package Commands to install npm i mongoose MongoDB Compass download install Connect with compass mongodb+srv://shairy:shairy@123@demo.d8fem.mongodb.net/testMongoDB Connect with application 4. Go to Config .env file and paste MONGO_URI = mongodb+srv://shairy:shairy@123 @demo.d8fem.mongodb.net /portfolio?retryWrites=true&w=majority 5. Create a new file db.js under config 6. Handle…
-

Install Middleware – Step 4
Step 4: -Install Middleware MiddleWare =>advance Result util=>errorresponse.js
-

Install Middleware – Step 4
Step 4: -Install Middleware Install middleware using command npm i morgan i.e. HTTP request logger middleware for node.js const morgan = require(‘morgan’); if (process.env. NODE_ENV==”DEVELOPMENT”) { app.use(morgan(‘dev’)) } Create 2 new folders with name middleware and util for Error Handling. Middleware=>async.js Middleware=>error.js