Created
October 10, 2018 20:02
-
-
Save jkyberneees/48b8044b9d8eb73575e32d3e575b370d 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 http = require('http') | |
| const service = new http.Server() | |
| service.on('request', (req, res) => { | |
| if (req.method === 'GET' && req.url === '/hi') { | |
| res.writeHead(200, { 'Content-Type': 'text/plain' }) | |
| res.end('Hello World!') | |
| } else { | |
| res.statusCode = 404 | |
| res.end() | |
| } | |
| }) | |
| service.listen(3000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment