const router2 = new KoaRouter();
router2.get(`/test`, async function(ctx, next) {
ctx.body = 'api test';
});
const router = new KoaRouter();
router.get(`/1`, router2.routes(), router2.allowedMethods());
router.get(`/test`, async function(ctx, next) {
ctx.body = 'test';
});
127.0.0.1:300/test
работает
127.0.0.1:300/1/test
не работает
Я не вижу проблемы?
router.use('/1', async function(ctx, next) { ctx.body = 'test'; });
- person Deendayal Garg   schedule 23.09.2016router.use
вместоrouter.get
. - person Deendayal Garg   schedule 23.09.2016