const Router = require('koa-router');
const sys = require('../config/sys.json');
const error = require('../intercept/error');
const router = new Router();
const roter_modulars = [
  require('./user'),
  require('./case'),
  require('./news'),
  require('./public')
];

router.use(error('error', sys.err_sendee));
// router.use(permission);


for (modular of roter_modulars) {
  router.use(modular.path || '/', modular.router.routes(), modular.router.allowedMethods());
}

module.exports = router;