1 use actix_web
::{get
, web
, App
, HttpServer
, Responder
};
3 #[get("/hello/{name}")]
4 async
fn greet(name
: web
::Path
<String
>) -> impl Responder
{
5 format
!("Hello {name}!")
8 #[actix_web::main] // or #[tokio::main]
9 async
fn main() -> std
::io
::Result
<()> {
11 App
::new().service(greet
)
13 .bind(("127.0.0.1", 8080))?