Only mock certain base URLs #1636
-
ScopeAdds a new behavior Compatibility
Feature descriptionApologies if this is already possible, but if so I can't see how to do it. It would be hugely useful if MSW could be set up to only intercept calls to a particular base URL, and ignore anything else. So, for example, I could set it up to only mock calls going to "http://api.example.com/api/" and anything underneath that. Any calls made to any other URLs would be ignored and do exactly what the browser would normally do without MSW. This would allow me to, for example, use
Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
For now, what I've done is add the following to the end of the list of handlers passed in to
|
Beta Was this translation helpful? Give feedback.
-
Hi, @sazzer. Please see my original answer as to how to implement a base path for relative request matching. Hope it helps. |
Beta Was this translation helpful? Give feedback.
Hi, @sazzer.
Please see my original answer as to how to implement a base path for relative request matching. Hope it helps.