import express from 'express' const app = express() const port = 3001 // Hello World. app.get('/hello', (req, res) => { res.send('Hello World!') }) // Listen on the given port const server = app.listen(port, () => { console.log(`Example app listening on http://localhost:${server.address().port}/`) })