nocobase/packages/app/mock/api.ts

12 lines
273 B
TypeScript
Raw Normal View History

2021-05-23 00:38:08 +00:00
import Mock from 'mockjs';
import * as resources from './resources';
export default {
'/api/:resource::action': (req: any, res: any) => {
const action = resources[req.params.resource][req.params.action];
if (action) {
return action(req, res);
}
},
}