2024-05-02 23:24:52 +00:00
|
|
|
use actix_web::{App, get, HttpResponse, HttpServer, Responder};
|
|
|
|
|
|
|
|
#[actix_web::main]
|
|
|
|
async fn main() -> std::io::Result<()> {
|
|
|
|
HttpServer::new(|| App::new().service(hello))
|
|
|
|
.bind(("127.0.0.1", 8000))?
|
|
|
|
.run()
|
|
|
|
.await
|
|
|
|
}
|
|
|
|
|
|
|
|
#[get("/")]
|
|
|
|
async fn hello() -> impl Responder {
|
|
|
|
HttpResponse::Ok().body("Hello World!")
|
2024-05-02 23:04:52 +00:00
|
|
|
}
|