Initialize the project:
npm initInstall the necessary dependencies:
npm install express http --saveCreate the home script:
touch index.jsInstall nodemon:
npm install nodemon -gWrite the server file:
let express = require('express')
let http = require('http')
// Initializes an express app.
let app = express()
// Gets the first route: '/'.
app.get('/', function(req, res) {
// Sends "HELLO WORLD"
res.send("HELLO WORLD")
})
// Creates a new http server with app and listens on localhost:8080 in your browser.
http.createServer(app).listen('8080')