1
0
mirror of https://github.com/actix/actix-website synced 2025-04-22 13:24:52 +02:00
2019-06-18 16:44:43 -04:00

18 lines
383 B
Rust

// <setup>
use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer, Responder};
fn index(_req: HttpRequest) -> impl Responder {
HttpResponse::Ok().body("Hello world!")
}
// </setup>
// <main>
fn main() {
HttpServer::new(|| App::new().route("/", web::get().to(index)))
.bind("127.0.0.1:8088")
.unwrap()
.run()
.unwrap();
}
// </main>