Skip to content

Instantly share code, notes, and snippets.

@aben
Created June 14, 2012 10:08
Show Gist options
  • Save aben/2929418 to your computer and use it in GitHub Desktop.
Save aben/2929418 to your computer and use it in GitHub Desktop.
//e.g. http://domain:8888/?sleep=5000
var http = require("http");
var url = require("url");
var query = require("querystring");
http.createServer(function(request, response) {
var str = url.parse(request.url).query;
var obj = query.parse(str);
setTimeout(function(){
response.end();
}, obj.sleep);
}).listen(8888);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment