mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
18 lines
320 B
TypeScript
18 lines
320 B
TypeScript
import { http, HttpResponse } from 'msw'
|
|
import { setupWorker } from 'msw/browser'
|
|
|
|
const worker = setupWorker()
|
|
worker.start()
|
|
|
|
worker.use(
|
|
http.get('/v1/issues', () => {
|
|
return HttpResponse.text('get-body')
|
|
}),
|
|
)
|
|
|
|
worker.use(
|
|
http.post('/v1/issues', () => {
|
|
return HttpResponse.text('post-body')
|
|
}),
|
|
)
|