/express-1a
>npm init
>npm install http-status-codes express
"use strict"; const port = 3000, express = require("express"), codes = require('http-status-codes'), app = express(), msg = `Server started on port: ${port}`; //simple function to log a startup note const started = () => console.log(msg); const homeFct = (req, res) => { res.type('html'); res.status(codes.OK); res.send('Greetings from the web server'); }; //route home path "/" to "homeFct" app.get("/", homeFct); //start the web server app app.listen(port, started);
>node main