This is a little bit tricky:
https://github.com/actix/actix-web/issues/2702
-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};
use actix_web::http::header;
use actix_web::middleware::Logger;
use actix_files::{Files, NamedFile};
+#[route("/hello/{name}", method="GET", method="HEAD")]
async fn hello(params: web::Path<String>, req: HttpRequest) -> Result<String> {
let name = params.into_inner();
async fn hello(params: web::Path<String>, req: HttpRequest) -> Result<String> {
let name = params.into_inner();