step: 1
install node js this url https://nodejs.org/en/
step: 2
open command prompt check node version : node --version
step: 3
now create sample project with specific folder node js type : npm init -y
step: 4
than install express js type: npm install express --save
step: 5
create index.js file add snippets code :
const express = require("express");
const app = express();
app.get("/itselfdata", function (req, res) {
res.send({
name: "ajay vishwakarma",
profession:"software developer"
})
});
app.listen(44859, '192.168.0.106' || 'localhost',function () {
console.log("server is running on port 44859");
});
run on postman : http://192.168.0.106:44859/itselfdata
step: 6
run index.js file : node index.js
step: 7
- you must install nodemon type : npm install -g nodemon
- than you can run nodemon index.js
Note : nodemon is utility that will monitor for any changes in your source code and automatically
restart your server.
install node js this url https://nodejs.org/en/
step: 2
open command prompt check node version : node --version
step: 3
now create sample project with specific folder node js type : npm init -y
step: 4
than install express js type: npm install express --save
step: 5
create index.js file add snippets code :
const express = require("express");
const app = express();
app.get("/itselfdata", function (req, res) {
res.send({
name: "ajay vishwakarma",
profession:"software developer"
})
});
app.listen(44859, '192.168.0.106' || 'localhost',function () {
console.log("server is running on port 44859");
});
run on postman : http://192.168.0.106:44859/itselfdata
step: 6
run index.js file : node index.js
step: 7
- you must install nodemon type : npm install -g nodemon
- than you can run nodemon index.js
Note : nodemon is utility that will monitor for any changes in your source code and automatically
restart your server.
0 Comments