concept express.js application in category node
appears as: n Express.js application, Express.js application

This is an excerpt from Manning's book Serverless Applications with Node.js.
Listing 13.1 Express.js app
'use strict' const express = require('express') const app = express() #1 app.get('/', (req, res) => res.send('Hello World')) #2 const port = process.env.PORT || 3000 #3 app.listen(port, () => console.log(`App listening on port ${port}`)) #4 #1 Create the Express.js application. #2 Create the GET route that answers with the “Hello World” text. #3 Set the port to PORT passed via an environment variable, or port 3000. #4 Start the application on the defined port.