mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
20 lines
723 B
JavaScript
20 lines
723 B
JavaScript
import koaRouter from 'koa-router'
|
|
import interfaceController from './controllers/interface.js'
|
|
import groupController from './controllers/group.js'
|
|
|
|
const router = koaRouter();
|
|
|
|
const INTERFACE_PREFIX = {
|
|
interface: '/interface/',
|
|
user: '/user/',
|
|
group: '/group/'
|
|
};
|
|
|
|
router.post ( INTERFACE_PREFIX.interface + 'add', interfaceController.add)
|
|
.get ( INTERFACE_PREFIX.interface + 'list', interfaceController.list)
|
|
.get ( INTERFACE_PREFIX.group + 'list', groupController.list)
|
|
.post ( INTERFACE_PREFIX.group + 'add', groupController.add)
|
|
.post ( INTERFACE_PREFIX.group + 'up', groupController.up)
|
|
.post ( INTERFACE_PREFIX.group + 'del', groupController.del)
|
|
|
|
module.exports = router |