Skip to content

Instantly share code, notes, and snippets.

@MiLk
Last active August 29, 2015 13:58
Show Gist options
  • Save MiLk/9970360 to your computer and use it in GitHub Desktop.
Save MiLk/9970360 to your computer and use it in GitHub Desktop.
Simple http server
game_name: echo-env
id: 2
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);
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