Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Last active December 16, 2019 16:57
Show Gist options
  • Select an option

  • Save ryanlid/e732c29e457e5787dbdd1d6858080d00 to your computer and use it in GitHub Desktop.

Select an option

Save ryanlid/e732c29e457e5787dbdd1d6858080d00 to your computer and use it in GitHub Desktop.
HTTP Server by Node.js
const http = require('http')
const app = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': "text/plain" });
res.end('Hello World\n');
})
app.listen(4000, '0.0.0.0');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment