rename Resource::middleware to Resource::wrap and add wrap_fn for fn middlewares

This commit is contained in:
Nikolay Kim 2019-03-25 12:47:58 -07:00
parent 1970c99522
commit 939d2e745c
3 changed files with 149 additions and 4 deletions

View file

@ -33,7 +33,7 @@ fn main() -> std::io::Result<()> {
.service(no_params)
.service(
web::resource("/resource2/index.html")
.middleware(
.wrap(
middleware::DefaultHeaders::new().header("X-Version-R2", "0.3"),
)
.default_resource(|r| {