Author: ShairyPortfolio
-

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
-

-

Setup Server for production and development Step – 3
Step 3: -Setup Server for production and development Create a new folder with name config and then inside it create new file with name config.env. NODE_ENV=DEVELOPMENT PORT=5000 Import and Use Dependency in server.js Npm run dev or nodemon Ctrl^ c Npm start Install Git using git init command Create a new file. git ignore to…
-

Setup API Project – Step 2
Step 2: -Setup API Project Download NodeJS Create a new folder with any Name Open this folder with any Editor like VS Code Crete a file Server.js for the entry point Crete package. json file via npm init command on terminal by use ctrl ~ Shortcut Install dependency npm i express i.e. Fast, minimalist web…