4 ms·
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 clie
by duxup 7y ago
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?
- acemarke 7y agoFrom reading the docs and the source, it's not a proxy. It looks like it uses https://github.com/pretenderjs/pretender 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.
- duxup 7y agoAh thank you!
- lukenyc 7y agoWe 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.