regex_router-1.0.0 has been yanked.
rs-regex-router
An implementation of request routing via a singular grouped regex (with support for path parameter extraction).
Features
- Design approach based upon this article.
- Implemented over a generic handler type allowing use with varying webserver crates.
- Extraction of path parameters which are then mapped as key/value pairs.
- A convenience macro for easily declaring routes.
Installation & Basic Usage
[]
= "1.0.0"
An example using a unit handler type:
use ;
...
let mut builder = new;
route!;
route!;
let router = builder.build.unwrap;
An example declaring path parameters:
let mut builder = new;
route!;
route!;
let router = builder.build.unwrap;
Dispatching against a router:
match router.dispatch ;
An example implementation for hyper
can be found here.
Issues & Support
Whether you're wanting to report a bug you've come across during use of this crate or are seeking general help/assistance, please utilise the issues tracker and provide as much detail as possible (eg. recreation steps).
I try to respond to issues within a reasonable timeframe.