Author: ShairyPortfolio
-

Create Controller Step- 7
Step 7: -Create Controller Crete a new folder with name controllers Create a new file inside folder route with any name like teamMember.js For File Uploading use the following in config.env FILE_UPLOAD_PATH=./public/uploads MAX_FILE_UPLOAD=1000000 Install npm I express-fileupload Use following in server file const fileupload = require(‘express-fileupload’); app.use(fileupload()); //File upload app.use(express.static(path.join(__dirname,’public’))); //static folder const path= require(‘path’);
-

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