1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 14:49:20 +02:00

reexpost extractors in web module

This commit is contained in:
Nikolay Kim
2019-03-07 11:43:46 -08:00
parent 22708e78a9
commit ceb6d45bf2
6 changed files with 41 additions and 42 deletions

View File

@ -35,7 +35,8 @@ pub fn get(args: TokenStream, input: TokenStream) -> TokenStream {
#ast
actix_web::dev::HttpServiceFactory::register(
actix_web::Resource::new(#path)
.route(actix_web::web::get().to(#name)), config);
.guard(actix_web::guard::Get())
.to(#name), config);
}
}
})
@ -71,7 +72,8 @@ pub fn post(args: TokenStream, input: TokenStream) -> TokenStream {
#ast
actix_web::dev::HttpServiceFactory::register(
actix_web::Resource::new(#path)
.route(actix_web::web::post().to(#name)), config);
.guard(actix_web::guard::Post())
.to(#name), config);
}
}
})
@ -107,7 +109,8 @@ pub fn put(args: TokenStream, input: TokenStream) -> TokenStream {
#ast
actix_web::dev::HttpServiceFactory::register(
actix_web::Resource::new(#path)
.route(actix_web::web::put().to(#name)), config);
.guard(actix_web::guard::Put())
.to(#name), config);
}
}
})