Skip to content

Running MSW in production #1012

Answered by kettanaito
alejandronanez asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @alejandronanez.

You can use MSW in production for your POC. Endpoints you mock don't have to exist at all, MSW will perform request path matching regardless if the endpoint exists (that's the entire point!).

There are no downsides as to using the worker in production, except your users communicating with the mocked API. In the case of demos and POCs that's an affordable limitation, I think.

Once the production endpoints are ready, it will be possible that the MSW still takes over and we can't send real data to the users.

Once you enable the production endpoints, deploy the next version of your app where you don't call worker.start(). There's a self-destructive mechanism built-in i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alejandronanez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants