shabashj
8/17/2016 - 12:49 PM

Slow http server

Slow http server

var express = require('express');
var slow = require('connect-slow');

var server = express();

server.use(slow({
    url: /\.json$/i,
    delay: 3000
}));
server.use(express.static(__dirname + '/'));

var port = 8888;
server.listen(port, function() {
    console.log('Very nice server listening on port ' + port + ' and response with delay');
});
{
  "name": "tempserver",
  "version": "1.0.0",
  "description": "nice",
  "main": "server.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "keywords": [
    "server"
  ],
  "author": "Evgeni",
  "license": "ISC",
  "dependencies": {
    "connect-slow": "^0.2.2",
    "express": "^4.14.0"
  }
}