Skip to content

Instantly share code, notes, and snippets.

@hyponymous
Created December 8, 2015 23:14
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 hyponymous/d0cd0044682fe08d31cf to your computer and use it in GitHub Desktop.
Save hyponymous/d0cd0044682fe08d31cf to your computer and use it in GitHub Desktop.

Run the server:

npm run start

Test the server by loading http://localhost:8080/ in a browser, or run

time curl http://localhost:8080/
var http = require('http');
http.createServer(function(request, response) {
setTimeout(function() {
response.end('ending');
}, 500);
}).listen(8080, function() {
console.log('listening on', 8080);
});
{
"name": "slow-server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment