Skip to content

Instantly share code, notes, and snippets.

@eladb
Created June 23, 2012 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eladb/2980218 to your computer and use it in GitHub Desktop.
Save eladb/2980218 to your computer and use it in GitHub Desktop.
mylittlepaas - app with asciimo
var http = require('http');
var urlparse = require('url').parse;
var asciimo = require('asciimo').Figlet;
http.createServer(function(req, res) {
if (req.url === '/mysupersecretdeploymentendpoint' && req.method === 'POST') {
console.log('Post-receive trigger. Exiting in 1.5 second');
setTimeout(function() { process.exit(1); }, 1500);
return res.end();
}
asciimo.write('hello, world', 'Banner', function(art) {
res.end(art);
});
}).listen(process.env.port || 5000);
console.log('My little PaaS 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