path-match - koa route middleware

  •        0

[![NPM version][npm-image]][npm-url][![build status][travis-image]][travis-url][![Test coverage][coveralls-image]][coveralls-url][![Gittip][gittip-image]][gittip-url]A simple routing wrapper around [path-match](https://github.com/expressjs/path-match).Similar to [koa-route](https://github.com/koajs/route) except it doesn't check methods.All of these routers use [path-to-regexp](https://github.com/component/path-to-regexp)underneath, which is what Express uses as well.```jsvar route = require('koa-path-match')({/* options passed to path-to-regexp */})app.use(route('/:id(\\d+)', function* (next) { var id = this.params.id // do stuff switch (this.request.method) { }}))```

https://github.com/koajs/path-match

Tags
Implementation
License
Platform

   

comments powered by Disqus


Related Projects