Last active
October 14, 2016 18:27
-
-
Save iamso/134cd1864261fa265addc6aa6583b092 to your computer and use it in GitHub Desktop.
Simple Node.js Http Server
This file contains 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 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