Demo✨: Using mswjs to create serverside & client side mocks + work on your app offline #4982
Replies: 2 comments
-
This is great! A note for anyone who's looking to try it out that the demo uses |
Beta Was this translation helpful? Give feedback.
-
Just wanted to say thanks for this @cliffordfajardo! 🙏 This was a great help to get This should probably be added to https://github.com/remix-run/examples/tree/main/msw. 🚀 I believe that starting the Also, from a quick test, it appears that the // app/entry.server.tsx
import { startMockServer } from './msw-server'
import { peopleHandlers} from './msw-handlers'
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") {
startMockServer([...peopleHandlers]);
} |
Beta Was this translation helpful? Give feedback.
-
Created an example repo of running MSW on the server.
If you're unfamiliar with MSW its a request interception library that makes mocking responses on the server or browser easier.
Demo
msw-nodejs-example.mp4
demo video showcases:
Highlights
References
Beta Was this translation helpful? Give feedback.
All reactions