X-Git-Url: https://piware.de/gitweb/?p=learn-rust.git;a=blobdiff_plain;f=actix-server%2Fsrc%2Fmain.rs;fp=actix-server%2Fsrc%2Fmain.rs;h=4a43ef55b36d8b1f2ccf31f84d11979a1efd35fd;hp=c73e7add5ee333cfecb7b72a2ac64e8595940b65;hb=7580ac5646156d35fd83b65f7d0bd959a896fb6c;hpb=f5c4a6a87fc589dec2f23bee0196beb07d427ae7 diff --git a/actix-server/src/main.rs b/actix-server/src/main.rs index c73e7ad..4a43ef5 100644 --- a/actix-server/src/main.rs +++ b/actix-server/src/main.rs @@ -1,11 +1,11 @@ use std::path::Path; -use actix_web::{get, web, App, HttpRequest, HttpServer, Responder, Result}; +use actix_web::{get, route, web, App, HttpRequest, HttpServer, Responder, Result}; use actix_web::http::header; use actix_web::middleware::Logger; use actix_files::{Files, NamedFile}; -#[get("/hello/{name}")] +#[route("/hello/{name}", method="GET", method="HEAD")] async fn hello(params: web::Path, req: HttpRequest) -> Result { let name = params.into_inner();