mirror of
https://github.com/actix/actix-website
synced 2025-03-15 20:53:07 +01:00
19 lines
394 B
Rust
19 lines
394 B
Rust
// <setup>
|
|
extern crate actix_web;
|
|
use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer};
|
|
|
|
fn index(_req: HttpRequest) -> HttpResponse {
|
|
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>
|