1.0.2 • Published 4 years ago

@ovis/mock v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

mock

使用

启动

mock
mock ./mock
pm2 start mock
pm2 start mock -- ./mock

存响应

在服务端真实响应回来的时候,再发一份给4001端口做json存储
wx.request({ url: 'http://localhost:4001', data: { url, res.data }, method: 'POST' }) // wx会包一层data,传之前要去掉
wx要把域名合法性校验关了

使用响应

改请求的host为http://localhost:4000

手动存响应mock

手写json文件,url中的/用_代替,如http://localhost/a/b,可以建文件a_b.json

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago