mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
20 lines
298 B
TypeScript
20 lines
298 B
TypeScript
import { http, passthrough, HttpResponse } from 'msw'
|
|
import { setupWorker } from 'msw/browser'
|
|
|
|
const worker = setupWorker(
|
|
http.post('/', () => {
|
|
return passthrough()
|
|
}),
|
|
)
|
|
|
|
worker.start()
|
|
|
|
Object.assign(window, {
|
|
msw: {
|
|
worker,
|
|
http,
|
|
passthrough,
|
|
HttpResponse,
|
|
},
|
|
})
|