Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1.16 KB

README.md

File metadata and controls

25 lines (15 loc) · 1.16 KB

The Serve library logo

@msw/serve

Spawn a standalone HTTP server from your Mock Service Worker handlers, or apply them as middleware to an existing Express, Hono, or Fastify servers.

When to use this?

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 curl your mock definitions locally;
  • When prototyping a Node.js backend implementation;
  • When integrating API mocking in a complex application architecture (i.e. for dockerized applications).

Documentation

Read the documentation.

Mentions