iron_middlefiddle
- Route specific middleware made easy
There are cases where you may only want specific routes within
a Router
to use some
piece of middleware (e.g. routes that require the user to be logged in). Adding
route-specific middleware in Iron is a repetitive and messy business which is
where iron_middlefiddle
comes in. It provides a convenience macro for adding
one or more
BeforeMiddleware
or
AfterMiddleware
s
to multiple routes at once.
Installation
If you're using Cargo, just add iron_middlefiddle
to your Cargo.toml:
[]
= "0.1.1"
Example usage
extern crate iron_middlefiddle;
extern crate iron;
extern crate mount;
extern crate router;
use Middleware;
use Mount;
use Router;
Documentation
The documentation for iron_middlefiddle
is available on
docs.rs.
License
iron_middlefiddle
is released under the MIT
LICENSE
.
If you require a different license to be able to use this crate, please get in touch.
About
This crate was written by Elliot Jackson.
- Blog: https://elliotekj.com
- Email: elliot@elliotekj.com