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

17 lines
321 B
Rust

// <setup>
extern crate actix_web;
use actix_web::{server, App, HttpRequest};
fn index(_req: &HttpRequest) -> &'static str {
"Hello world!"
}
// </setup>
// <main>
fn main() {
server::new(|| App::new().resource("/", |r| r.f(index)))
.bind("127.0.0.1:8088")
.unwrap()
.run();
}
// </main>