From 91d61f5be6e30dc7805708f3da79acf7dd5191db Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 5 Mar 2022 23:34:28 +0000 Subject: [PATCH] update homepage example --- layouts/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 7856907..981c161 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -50,8 +50,8 @@
{{ highlight `use actix_web::{get, web, App, HttpServer, Responder}; -#[get("/{name}")] -async fn greet_person(name: web::Path) -> impl Responder { +#[get("/hello/{name}")] +async fn greet(name: web::Path) -> impl Responder { format!("Hello {name}!") } @@ -59,8 +59,8 @@ async fn greet_person(name: web::Path) -> impl Responder { async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() - .route("/", web::get().to(|| async { "Hello World!" })) - .service(greet_person) + .route("/hello", web::get().to(|| async { "Hello World!" })) + .service(greet) }) .bind(("127.0.0.1", 8080))? .run()