koajs/route — pull request #12 by hallas (2014-04-24 02:06:03+00:00)
Title: Added support for paramification

This is inspired by koa-params, but I want it in the router, not as a
hard shell around it as that means most new features in the router
won’t be available once params has taken over.

This allows for `route.param(name, fn*)`. The `fn*` receives the
context and can perform some neat stuff like retrieving resources based
on ids in the path. These functions I call paramifiers and they are
yielded before any route handlers. They can throw if somethings wrong,
for example 404 if a resource is missing.