Skip to content

Instantly share code, notes, and snippets.

@mrvisser
Created March 20, 2013 12:51
Show Gist options
  • Save mrvisser/5204396 to your computer and use it in GitHub Desktop.
Save mrvisser/5204396 to your computer and use it in GitHub Desktop.
var express = require('express');
var app = express();
var emitter = new require('events').EventEmitter();
app.get('/marco', function(req, res) {
res.send(200, 'Shut up');
console.log('Marco!');
setTimeout(_handlePolo, 10000);
});
var server = app.listen(3000);
process.on('SIGINT', function() {
console.log('Got kill. Processing.');
server.close();
});
var _handlePolo = function() {
console.log('polo');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment