1
0
mirror of https://github.com/actix/actix-website synced 2025-02-24 04:53:20 +01:00

19 lines
394 B
Rust
Raw Normal View History

2018-05-23 23:25:51 +02:00
// <setup>
extern crate actix_web;
2019-06-12 04:51:45 -04:00
use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer};
2018-05-23 23:25:51 +02:00
2019-06-12 04:51:45 -04:00
fn index(_req: HttpRequest) -> HttpResponse {
HttpResponse::Ok().body("Hello world!")
2018-05-23 23:25:51 +02:00
}
// </setup>
2019-06-12 04:56:59 -04:00
2018-05-23 23:25:51 +02:00
// <main>
fn main() {
2019-06-13 00:33:32 -04:00
HttpServer::new(|| App::new().route("/", web::get().to(index)))
.bind("127.0.0.1:8088")
2018-05-23 20:39:15 -07:00
.unwrap()
2019-06-12 04:51:45 -04:00
.run()
.unwrap();
2018-05-23 23:25:51 +02:00
}
// </main>