đź“ť Edit page
âž• Add page
Basic
Basic greeting
server.js
const express = require('express'); const app = express(); const port = 3000; app.get('/', (req, resp) => resp.send('Hello, world!')) app.listen(port, () => console.log(`Example app listening at http://localhost:${port}/`))
Run as:
$ node server.js
Example app listening at http://localhost:3000/
Open browser at:
Note that you’ll get an error on other paths.