mirror of
https://github.com/actix/actix-website
synced 2024-12-03 20:22:13 +01:00
16 lines
328 B
Rust
16 lines
328 B
Rust
|
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>
|