From 49f38a56618631576b672c9c9575bb8fcf91badf Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sun, 7 Mar 2021 13:11:50 +0100 Subject: init --- src/main.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..594491f --- /dev/null +++ b/src/main.rs @@ -0,0 +1,13 @@ +use actix_web::{web, App, HttpResponse, HttpServer}; +#[actix_rt::main] +async fn main() -> std::io::Result<()> { + HttpServer::new(|| { + App::new().service( + web::resource("/") + .to(|| HttpResponse::Ok().body("Hello from Rust!")), + ) + }) + .bind("127.0.0.1:8080")? + .run() + .await +} -- cgit v1.2.3-18-g5258