Json-server: Add delay when using module

Created on 6 May 2017  路  3Comments  路  Source: typicode/json-server

Currently delay is supported on CLI, how can i add this option when using a module?

thanks.

Most helpful comment

Do this mate:

require connect-pause module:

var pause = require('connect-pause');

Add after jsonServer.use(middlewares))

// pause in ms
jsonServer.use(pause(1000));

All 3 comments

Do this mate:

require connect-pause module:

var pause = require('connect-pause');

Add after jsonServer.use(middlewares))

// pause in ms
jsonServer.use(pause(1000));

thanks!

Do this mate:

require connect-pause module:

var pause = require('connect-pause');

Add after jsonServer.use(middlewares))

// pause in ms
jsonServer.use(pause(1000));

you are da men! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rutvik17 picture Rutvik17  路  4Comments

boydenhartog picture boydenhartog  路  3Comments

sharpmachine picture sharpmachine  路  4Comments

strom picture strom  路  4Comments

dotmobo picture dotmobo  路  4Comments