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

17 lines
321 B
Rust
Raw Normal View History

2018-05-23 23:25:51 +02:00
// <setup>
extern crate actix_web;
2018-05-23 20:39:15 -07:00
use actix_web::{server, App, HttpRequest};
2018-05-23 23:25:51 +02:00
2018-07-21 05:21:41 -07:00
fn index(_req: &HttpRequest) -> &'static str {
2018-05-23 23:25:51 +02:00
"Hello world!"
}
// </setup>
// <main>
fn main() {
2018-05-23 20:39:15 -07:00
server::new(|| App::new().resource("/", |r| r.f(index)))
.bind("127.0.0.1:8088")
.unwrap()
.run();
2018-05-23 23:25:51 +02:00
}
// </main>