First, install Yeoman and generator-mock-server using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-mock-server
Then generate your new project: 创建一个mock api服务器
yo mock-server
创建一个新的接口
yo mock-server:api apiFileName
//input the requested path for this api
输入接口请求路径
input the method for requestting this api
输入接收的请求方法
post get put all ...
查看所有的接口
npm run start
接口返回的数据 自行修改对应的路由文件即可
- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to learn more about Yeoman.
MIT © zhangaifei