Last active
August 29, 2015 13:58
-
-
Save MiLk/9970360 to your computer and use it in GitHub Desktop.
Simple 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
game_name: echo-env | |
id: 2 |
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
var http = require('http'); | |
http.createServer(function (req, res) { | |
if (req.headers['user-agent']) { | |
console.log(req.headers); | |
} | |
res.writeHead(200, {'Content-Type': 'application/json'}); | |
res.end(JSON.stringify(process.env)); | |
}).listen(process.env.PORT); |
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
marathon: | |
source /opt/nvm/nvm.sh && \ | |
nvm use v0.10.26 && \ | |
node index.js | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment