typicode / json-server

Get a full fake REST API with zero coding in less than 30 seconds (seriously)
Other
73.05k stars 7.02k forks source link

Please, bring back the `--delay` option #1545

Open posti85 opened 6 months ago

posti85 commented 6 months ago

I have seen in the 1.0.0-alpha version the --delay option is missing, and the current suggestion is using the browser network throtling feature:

Notable differences with v0.17 ... use Chrome's Network tab > throtling to delay requests instead of --delay CLI option

The main problem with this approach is that, while we are testing our frontend application in the browser, EVERY request will be delayed (which includes styles, js chunks, fonts...) and in some cases it is tedious when we are dealing with a big application.

We usually only want to delay those requests related to backend, for example, for testing wether our frontend app is preapared to give a good loading/processing feedback while it is performing a backend request. The typical use case is having a slow backend which takes times to reply, but not always the network connection is slow.

So my suggestion is bringing back the --delay option. Make it available and optional like it was before, so the user decides to use it or not.

piotr-jura-udemy commented 6 months ago

I second this.

ArthurWillameBr commented 6 months ago

This very necessary

RuRu92 commented 1 week ago

Yes, we need this back !