Skip to content

boo1ean/express-delay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

express-delay

Delay express responses

Use case

You want to test your fancy ajax loaders, spinners and stuff, but your dev machine is too damn fast for that shit!

Usage

var app = require('express')();
var delay = require('express-delay');

// Delay all responses for 1 second
app.use(delay(1000));

// Response will be delayed for 1 second
app.get('/', function(req, res) {
	res.send('Hello world!');
});

// ...

Random delay

You can also give it a range of values, which will make the delay random:

// Delay will be between 200 and 500 milliseconds
app.use(delay(200, 500));

LICENSE

MIT

About

Delay express responses

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •