Created
December 16, 2018 19:45
-
-
Save jdstaerk/7a4c43ea94cefd682c12f20d95e9b0a8 to your computer and use it in GitHub Desktop.
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 os = require('os'); | |
| const http = require('http'); | |
| const requestHandler = (req, res) => { | |
| console.log('Request incoming from ' + req.connection.remoteAddress); | |
| res.writeHead(200); | |
| res.end('Success! You\'ve hit ' + os.hostname() + ' on ' + os.platform() + '!'); | |
| }; | |
| const server = http.createServer(requestHandler) | |
| server.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment