Skip to content

Instantly share code, notes, and snippets.

@iamso
Last active October 14, 2016 18:27
Show Gist options
  • Save iamso/134cd1864261fa265addc6aa6583b092 to your computer and use it in GitHub Desktop.
Save iamso/134cd1864261fa265addc6aa6583b092 to your computer and use it in GitHub Desktop.
Simple Node.js Http Server
const http = require('http');
const port = process.env.PORT || 1234;
const server = http.createServer((request, response) => {
response.end(`It works!! Url: ${request.url}`);
}).listen(port, () => {
console.log(`Server listening on http://localhost:${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment