Mock icon indicating copy to clipboard operation
Mock copied to clipboard

如何在控制台看到mock数据

Open fishermanxzx opened this issue 4 years ago • 3 comments

fishermanxzx avatar Oct 08 '21 07:10 fishermanxzx

想要在控制台network面板中看到mock返回的数据

fishermanxzx avatar Oct 08 '21 07:10 fishermanxzx

mockjs 的定位是由前端拦截 xhr 实现的数据接口模拟。并没有产生真正的后端接口,所以浏览器控制台是看不到滴。

你可以试试这个: https://github.com/wll8/mockm/blob/dev/README.zh.md

# 查看 node 版本, 目前 mockm 支持 node v10.12.0 以上版本
node -v

# 安装
npm i -D mockm

# 创建并使用模板运行
npx mockm --template 

# 浏览器打开 http://127.0.0.1:9005/#/apiStudio/

wll8 avatar Oct 08 '21 07:10 wll8

@wll8 thanks

fishermanxzx avatar Oct 08 '21 08:10 fishermanxzx