koajs / joi-router

Configurable, input and output validated routing for koa
MIT License
450 stars 96 forks source link

fn is not run before specific route when using router.use(path, fn) #83

Closed wdanxna closed 5 years ago

wdanxna commented 5 years ago

Document says:

To run middleware before a specific route, also pass the optional path:


const router = require('koa-joi-router');
const users = router();

users.get('/:id', handler);
users.use('/:id', runThisBeforeHandler);```

but runThisBeforeHandler is actually run after handler

aheckmann commented 5 years ago

fixed the docs