rererouter
Iron router with regex captures support.
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
and this to your crate root:
extern crate rererouter;
Example
extern crate iron;
extern crate regex;
extern crate rererouter;
use Captures;
use ;
use ;
use RouterBuilder;
Usage:
$ curl -i http://localhost:3000/hello-rererouter
HTTP/1.1 200 OK
Content-Length: 18
Content-Type: text/plain
Date: Mon, 27 Nov 2017 08:36:47 GMT
Hello, rererouter!
$ curl -i -X POST http://localhost:3000/count-to-10
HTTP/1.1 200 OK
Content-Length: 18
Content-Type: text/plain
Date: Mon, 27 Nov 2017 08:37:19 GMT
Let's count to 10!
$ curl -i http://localhost:3000/not-found
HTTP/1.1 404 Not Found
Content-Length: 9
Content-Type: text/plain
Date: Mon, 27 Nov 2017 08:42:30 GMT
Not found