1
0
mirror of https://github.com/actix/actix-website synced 2024-12-03 20:22:13 +01:00
actix-website/examples/application/src/main.rs

16 lines
328 B
Rust
Raw Normal View History

2018-05-23 21:28:12 +02:00
extern crate actix_web;
use actix_web::{App, Responder, HttpRequest, http::Method};
// <setup>
fn index(req: HttpRequest) -> impl Responder {
"Hello world!"
}
fn main() {
let app = App::new()
.prefix("/app")
.resource("/index.html", |r| r.method(Method::GET).f(index))
.finish();
}
// </setup>