Express.js is a framework that is use in the Node.js. It is having the Jade file which is similar to HTML file.
To install Express first we have to include the express version in Package.json file.
Inside Package.js
{
"name": "pong",
"version": "0.5.1",
"dependencies": {
"express":"*"
}
}
On the Command Prompt use this command.
$ npm install express
Inside the Server.js use this code.
var express = require('express')
var app = express()
app.get('/', function (req, res) {
res.send('Hello World')
})
app.listen(3000)
When you run on browser with this URL : localhost:3000 You will see the "Hello World" printed on the browser which means everything is perfect.
0 Comment(s)