Closed saadq closed 6 years ago
One thing I miss from koa-router is being able to prefix all your routes.
koa-router
For example:
import Router from 'koa-router' const router = new Router() router.get('/api/cars', async ctx => { }) router.get('/api/bikes', async ctx => { })
could be simplified to this:
import Router from 'koa-router' const router = new Router({ prefix: '/api' }) router.get('/cars', async ctx => { }) router.get('/bikes', async ctx => { })
This was quite useful when using a webpack dev server where I would proxy all routes starting with /api to my Node server.
webpack
/api
One thing I miss from
koa-router
is being able to prefix all your routes.For example:
could be simplified to this:
This was quite useful when using a
webpack
dev server where I would proxy all routes starting with/api
to my Node server.