'Whitelist / Pass Through All XHR Endpoints By Default
Out of the box, you have to specifically tell MirageJS which endpoints to mock out and which endpoints to pass through. If your app calls an endpoint that isn't targeted in Mirage's createServer()
function, MirageJS will throw an error.
Is there a way to change this behavior so that MirageJS will whitelist all XHR requests by default and only intercept requests that are explicitly defined in the routes()
method of createServer()
?
We integrate with a lot of 3rd party services and we want calls made to the endpoints for these services to work by default. It creates much more work when we have to explicitly figure out the domains / endpoints these libraries might call and then explicitly add them to MirageJS.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|