yapi/server_dist/router.js

31 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-07-03 16:16:05 +08:00
'use strict';
var _koaRouter = require('koa-router');
var _koaRouter2 = _interopRequireDefault(_koaRouter);
var _interface = require('./controllers/interface.js');
2017-07-03 16:16:05 +08:00
var _interface2 = _interopRequireDefault(_interface);
var _group = require('./controllers/group.js');
var _group2 = _interopRequireDefault(_group);
2017-07-05 17:59:53 +08:00
var _user = require('./controllers/user.js');
var _user2 = _interopRequireDefault(_user);
2017-07-03 16:16:05 +08:00
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var router = (0, _koaRouter2.default)();
var INTERFACE_PREFIX = {
interface: '/interface/',
user: '/user/',
group: '/group/'
2017-07-03 16:16:05 +08:00
};
2017-07-05 17:59:53 +08:00
router.post(INTERFACE_PREFIX.interface + 'add', _interface2.default.add).get(INTERFACE_PREFIX.interface + 'list', _interface2.default.list).get(INTERFACE_PREFIX.group + 'list', _group2.default.list).post(INTERFACE_PREFIX.group + 'add', _group2.default.add).post(INTERFACE_PREFIX.group + 'up', _group2.default.up).post(INTERFACE_PREFIX.group + 'del', _group2.default.del).get(INTERFACE_PREFIX.user + 'list', _user2.default.list).post(INTERFACE_PREFIX.user + 'add', _user2.default.add).post(INTERFACE_PREFIX.user + 'up', _user2.default.up).post(INTERFACE_PREFIX.user + 'del', _user2.default.del);
2017-07-03 16:16:05 +08:00
module.exports = router;