moc
前端构造数据服务
安装
npm i moc --save # global install sudo npm i moc -g
const config = mockRoot: __dirname // 默认项目跟目录 port: 3000 // 启动端口 tasks: // 任务处理函数 { return data: 0 message: 'success' } { let level method = ctxparams return `./web//` } mapping: // 请求任务映射关系 modifyTask: '**/modify' '**/update' webTask: 'web/user/:level/:method' static: direction: __dirname extensions: 'html' 'js' 'css' plugins: { // koa handler if ctxrequestpath ctxresponse } mockstartconfig