added tasting code

This commit is contained in:
2023-09-12 21:46:26 +00:00
parent 1fea9c2d07
commit 6abcfd1334
6 changed files with 124 additions and 0 deletions

19
src/main.rs Normal file
View File

@@ -0,0 +1,19 @@
use actix_web::{get, web, App, HttpServer, Responder};
#[get("/")]
async fn index() -> impl Responder {
"Hello, World!"
}
#[get("/{name}")]
async fn hello(name: web::Path<String>) -> impl Responder {
format!("Hello {}!", &name)
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| App::new().service(index).service(hello))
.bind(("127.0.0.1", 8080))?
.run()
.await
}