Package Setup Nodejs MySQL CRUD
#nodejs #javascriptframework#programming fullstack#backend#programming#coding#webdevelopment#developer
Package Setup
-Go to npmjs.com and Install nodemon
-install locally
npm i nodemon
-checkout pkg.json file
-mention the file name in server: nodemon server.js
-Test the app - npm run server.js
-Install the middleware npm i morgan
pkg name- morgan
-Define it in server.js
const morgan=require('morgan')
//middleware
app.use(morgan("dev"))
-Secure the port number through env pkg
-Install the dotenv pkg
npm i dotenv
-Create an .env file in root directory
-Define port in .env file
const PORT=8080
-Restart the server and import the .env file
-Configure dotenv it server.js file
const dotenv=require('dotenv')
dotenv.config()
-use process variable to define the port
const PORT =process.env.port || 8000
-Modify the listen port code
In questa pagina del sito puoi guardare il video online Package Setup Nodejs MySQL CRUD della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Learning Curve 21 maggio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 115 volte e gli è piaciuto 3 spettatori. Buona visione!