I'm starting devel on very small app, and decided to use koa Framework with koa-router ( among some other middleware in the future)
Question is that after specifying my routes, a strange catch-all, no method, no url route appears
// excerpt of /app/routes/admin
var router = require('koa-router')().prefix('/admin');
router.get('/a.html', function *(next){
return this.render('a', {some: 'data'})
})
router.get('/index.html', function *(next){
return this.render('index', {})
})
router.get('/b.html', function *(next){
return this.render('b', {})
})
module.exports = router
// excerpt of Main App
// routes
var adminRouter = require('/app/routes/admin')
this.app.use( adminRouter.routes())
this.app.use( adminRouter.allowedMethods())
// Checking Routes
console.log(adminRouter.stack.map(i => i.path));
... which, when run, gives the following result:
[ '(.*)',
'/admin/a.html',
'/admin/index.html',
'/admin/b.html' ]
From where the hell is (.*) coming?
Also, if I enable the debugging for koa-router, I get
koa-router defined route HEAD,GET /admin/list.html +46ms
koa-router defined route HEAD,GET /admin/index.html +1ms
koa-router defined route HEAD,GET /admin/queries.html +0ms
koa-router defined route (.*) +1ms
, so to make things even stranger, shows that this route has no associated method of any kind
Any idea of that "Phantom" entry?