1
0
mirror of https://github.com/actix/actix-website synced 2025-02-23 04:33:03 +01:00
2018-05-23 20:39:15 -07:00

17 lines
320 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>