Month: August 2021

Install Middleware – Step 4

Step 4: -Install Middleware Install middleware using command npm i morgan i.e. HTTP request logger middleware for node.jsconst morgan = require('morgan'); if (process.env....
READ MORE   >>

Install Middleware – Step 4

Step 4: -Install Middleware Middleware=>auth.js const jwt = require('jsonwebtoken'); const asyncHandler = require('./async'); const ErrorResponse = require('../util/errorResponse'); const user = require('../models/login'); //Protect...
READ MORE   >>

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 // Import...
READ MORE   >>

Setup API Project – Step 2

Step 2: -Setup API Project Download NodeJSCreate a new folder with any NameOpen this folder with any Editor like VS CodeCrete a file Server.js for the entry pointCrete package. json file via npm init command on terminal by use ctrl ~...
READ MORE   >>

Recent Comments

    • Copyright © 2020 (Er. Shairy Kalra). All Rights Reserved