Closed varHarrie closed 2 years ago
源码仓库:https://github.com/varHarrie/mokia 文档链接:https://varharrie.github.io/mokia/
简介:一个开箱即用的API模拟服务器,帮助快速创建后端原型和数据模拟。
特性:
用法:
创建入口文件(index.js):
module.exports = { port: 3000, 'GET /users'() { return this.list(() => ({ id: this.uuid(), name: this.fullName() })); }, 'GET /users/:id'(req) { return { id: req.params.id, name: this.fullName() }; }, };
启动本地服务器:
npx mokia index.js --watch
打开浏览器进入http://localhost:3000/users (opens new window),你就能看到响应信息了。
收,干得漂亮 :)
源码仓库:https://github.com/varHarrie/mokia 文档链接:https://varharrie.github.io/mokia/
简介:一个开箱即用的API模拟服务器,帮助快速创建后端原型和数据模拟。
特性:
用法:
创建入口文件(index.js):
启动本地服务器:
打开浏览器进入http://localhost:3000/users (opens new window),你就能看到响应信息了。