Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 3x 3x 3x 3x 12x 3x 3x | // const Router = require('koa-router')
// const express = require('express');
// const Router = express.Router();
// const compose = require('koa-compose')
const auth = require('../auth')
const routers = require('../app/controller')
// const config = require('../config/env')
// const apiRouter = new Router({
// prefix: config.baseApi,
// })
// apiRouter.get('/', async(ctx, next) => {
// ctx.redirect('/user');
// });
function initRoute(app) {
app.use('/api/auth', auth)
Object.keys(routers).forEach(name => {
return app.use(`/api/${name}`, routers[name])
});
}
module.exports = function (app) {
initRoute(app)
} |