Create an HTTP server with Express

$ mkdir server
$ cd server
$ npm init -y
$ npm i -S express
$ echo '
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => res.send('Hello, World!'))
app.listen(port, () => console.log(`listening on port ${port}`))
 > index.js
$ node index.js
listening on port 3000

Run it as a daemon

© RGZ.EE OÜ