md/mm.config.js
xw 1f5434fa07
feat: custom upload logic (#91)
* feat: Custom upload logic

* doc: update readme

* Update README.md
2021-11-24 14:31:19 +08:00

28 lines
584 B
JavaScript

/**
* 配置说明请参考文档:
* https://hongqiye.com/doc/mockm/config/option.html
* @type {import('mockm/@types/config').Config}
*/
module.exports = (util) => {
return {
api: {
'/upload'(req, res) {
res.json({
msg: `上传成功`,
url: util.libObj.mockjs.mock(`@image`),
})
},
},
static: [
{ // 测试 netlify 部署
fileDir: `./dist`,
path: `/`,
},
{ // 测试 gitee/github 部署
fileDir: `./dist`,
path: `/md`,
},
],
}
}