Skip to content

Instantly share code, notes, and snippets.

@eladb
Created June 23, 2012 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eladb/2978879 to your computer and use it in GitHub Desktop.
Save eladb/2978879 to your computer and use it in GitHub Desktop.
mylittlepaas - hello world with post-receive hook endpoint
var http = require('http');
http.createServer(function(req, res) {
if (req.url === '/mysupersecretdeploymentendpoint' && req.method === 'POST') {
console.log('Post-receive trigger. Exiting in 1 second');
setTimeout(function() { process.exit(1); }, 1000);
return res.end();
}
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