Run the server:
npm run start
Test the server by loading http://localhost:8080/ in a browser, or run
time curl http://localhost:8080/
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": { | |
} | |
} |