Skip to content

Instantly share code, notes, and snippets.

@writingdeveloper
Created November 28, 2017 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save writingdeveloper/8ae8243482cae20bb41a26f24b44ba46 to your computer and use it in GitHub Desktop.
Save writingdeveloper/8ae8243482cae20bb41a26f24b44ba46 to your computer and use it in GitHub Desktop.
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
http.createServer((req, res) => {
res.writeHead(200, {
'Content-Type': 'text/plain'
});
res.end('Hello World\n');
}).listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment