Created
June 23, 2012 16:21
-
-
Save eladb/2978879 to your computer and use it in GitHub Desktop.
mylittlepaas - hello world with post-receive hook endpoint
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
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