1#1. server.js
2var express = require('express');
3var app = express();
4
5app.get('/', function (req, res) {
6 res.status(200).send('Hello World!');
7});
8
9var port = process.env.PORT || 3000;
10
11var server = app.listen(port, function() {
12 console.log('Express server listening on port ' + port);
13});
14
15open cmd run server.js
16"node server.js"
17log:Express server listening on port 3000
18
19& then
20
21open link "http://localhost:3000/" in your browser and show result.