Hacker News new | past | comments | ask | show | jobs | submit login

I'm a bit of a noob so hang with me here.

So you install it as a dev dependency via npm.

So is it running ... with the client app as a proxy between the client application and just waiting for the API requests and taking those responding?

Is it possible to configure some delay in responses?




We use mirage with test-controlled response timings to be able to acceptance test loading states. Works great.

You can also configure a universal delay if you’re using mirage in development and want to get a feel for your app with a certain amount of latency.


From reading the docs and the source, it's not a proxy. It looks like it uses https://github.com/pretenderjs/pretender , which overwrites the original `XmlHttpRequest` and `fetch` functions in the browser to intercept any attempts to make AJAX requests. It then makes your attempted request with its own internal routing definitions, and returns the responses you defined.


Ah thank you!




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: