koajs / joi-router

Configurable, input and output validated routing for koa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

wdanxna opened this issue · comments

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

fixed the docs