use()
将请求处理程序添加到当前服务器实例的前面。
调用签名
¥Call signature
import { http } from 'msw'
import { setupServer } from 'msw/node'
const server = setupServer()
server.use(http.get('/resource', resolver), http.post('/resource', resolver))
只要当前 Node.js 运行时存在,前置的请求处理程序就会保留在服务器实例上。
¥The prepended request handlers persist on the server instance as long as the current Node.js runtime exists.
相关材料
¥Related materials