Spawn a standalone HTTP server from your Mock Service Worker handlers, or apply them as middleware to an existing Express, Hono, or Fastify servers.
You should always prefer Mock Service Worker for API mocking because it can meet most of your requirements without having to spawn and maintain an actual HTTP server. Please refer to the Getting started tutorial to integrate next-generation API mocking into your application.
There are, however, use cases when this extension can be applicable:
- If you wish to
curlyour mock definitions locally; - When prototyping a Node.js backend implementation;
- When integrating API mocking in a complex application architecture (i.e. for dockerized applications).
Read the documentation.
- David Idol, original implementation.