- Introduction
- Getting started
- Philosophy
- Comparison
- Limitations
- Debugging runbook
- FAQ
- Basics
- Concepts
- Network behavior
- Integrations
- API
- CLI
- Best practices
- Recipes
use()
Prepend request handlers to the current server instance.
Call signature
import { http } from 'msw'
import { setupServer } from 'msw/node'
const server = setupServer()
server.use(http.get('/resource', resolver), http.post('/resource', resolver))
The prepended request handlers persist on the server instance as long as the current Node.js runtime exists.