Created
January 30, 2021 22:12
-
-
Save noherczeg/98af2991b82a6df223e8746c809bb2ad to your computer and use it in GitHub Desktop.
node web hello-world
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const host = '0.0.0.0' | |
const port = 3000 | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200 | |
res.setHeader('Content-Type', 'text/plain') | |
res.end('Hello World!') | |
}) | |
server.listen(port, host, () => { | |
console.log('Web server running at http://%s:%s', host, port) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment