Skip to content

Instantly share code, notes, and snippets.

@sandfox
Forked from eladb/app.js
Last active December 16, 2015 11:29
Show Gist options
  • Save sandfox/5427445 to your computer and use it in GitHub Desktop.
Save sandfox/5427445 to your computer and use it in GitHub Desktop.
var http = require('http');
http.createServer(function(req, res) {
if (req.url === '/mysupersecretdeploymentendpoint' && req.method === 'POST') {
console.log('Post-receive trigger');
var body = '';
req.on('data', function(data){
body += data;
})
req.on('end', function(){
res.end();
//Now we can parse the body into json
//We should try/catch this as it can error
var githubData = JSON.parse(body);
})
}
res.end('Hello, little PaaS (v2)\n');
}).listen(process.env.port || 5000);
console.log('My little PaaS (v2) started on port', process.env.port || 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment