When I call /my/abc/create
, I always get status 400 because of the first entrypoint.
How can I call second endpoint? I prefer not to change the entrypoint order.
var Router = require('koa-router');
var router = Router();
router.get('/my/:path/:id', (ctx) =>{
if (isNaN(Number(cox.params.id))) { // if not numeric
ctx.status = 400;
return;
}
console.log('route id')
})
router.get('/my/:path/create', (ctx) =>{
console.log('route create')
})