Created
June 16, 2018 00:34
-
-
Save beatak/819e9e627f8ca4fcf21efdc6c5486d3f 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
| console.log('starting the web server!'); | |
| const http = require('http'); | |
| const _env = parseInt(process.env.PORT, 10); | |
| const PORT = _env ? _env : 80; | |
| http.createServer(function (req, res) { | |
| console.log(`Req: ${req.url}`); | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.end('hello world'); | |
| }).listen(PORT, function () { | |
| console.log('Start to listen!'); | |
| console.log( JSON.stringify( [].slice.apply(arguments, [0]) ) ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment