mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
14 lines
243 B
TypeScript
14 lines
243 B
TypeScript
import { http, HttpResponse } from 'msw'
|
|
import { setupWorker } from 'msw/browser'
|
|
|
|
const worker = setupWorker(
|
|
http.get('/user', () => {
|
|
return HttpResponse.html(`
|
|
<p class="user" id="abc-123">
|
|
Jane Doe
|
|
</p>`)
|
|
}),
|
|
)
|
|
|
|
worker.start()
|