User Tools

Site Tools


wiki:node_js_test_web_app

node.js test web app

Create separate directory:

mkdir server && cd server

Make server.js file with following content:

const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
  res.send('Hello World!')
})
app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
})

Then:

npm install express
node server.js

Tested on

  • Debian 11 Bullseye

See also

References

wiki/node_js_test_web_app.txt · Last modified: 2021/08/19 10:13 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki