DEV Community

Discussion on: Spawn an HTTP server from your Mock Service Worker request handlers.

Collapse
 
controlplusb profile image
Sean Matheson

Ah this approach saved me so much pain. I migrated from a pure SPA to Next.js and needed a way to consistently call my mocks across the browser and server environment. The problem was my mocks were stateful. I tried to recreate a backend like experience within them to prove the functionality before implementing the backend. Thank you for this!

Collapse
 
kettanaito profile image
Artem Zakharchenko

I'm so happy to hear that, Sean!
We've developed http-middleware precisely to ease setup migrations like yours. I'm glad to see it finds its applications in the wild.

Don't hesitate to let us know about any obstacles you encounter while using the library in GitHub issues.