模拟接口返回数据
可以让前端独立于后端进行开发
符合直觉;使用前端开发皆有的nodejs环境
可根据调用接口时的传参进行不用数据的返回
保存请求的记录,便于回溯
对于使用脚手架所进行的前端开发,仅需改变baseUrl即可
甚至,你可以把服务分享给小伙伴一起使用!
npm install
- 使用
config-template.js
模板文件创建config.js
npm start
- 直接访问接口url http://localhost:xxxx/xxxxxxxx/xxx
- 在已配置的文件夹下自动生成的文件中填写返回数据
- 再次访问url,获得返回数据
Allows the front-end to develop independently of the back-end.
Intuitive; uses a nodejs environment that is common to all front-end developers.
Returns unused data according to the parameters passed when calling the interface.
Keep a record of requests for easy backtracking.
For front-end development using scaffolding, you can simply change the baseUrl.
Even, you can share the service with your partners to use together!
npm install
- Create
config.js
usingconfig-template.js
template file. npm start
- Direct access to the interface url http://localhost:xxxx/xxxxxxxx/xxx .
- Fill in the return data in the automatically generated file under the configured folder.
- Re-visit the url to get the returned data.