1
0
mirror of https://github.com/actix/actix-website synced 2024-11-24 00:41:07 +01:00

Outdent examples

This commit is contained in:
Armin Ronacher 2018-05-27 10:49:14 -07:00
parent be72dac069
commit ede773dd93

View File

@ -6,31 +6,31 @@ mod state;
fn make_app() {
// <make_app>
fn index(req: HttpRequest) -> impl Responder {
"Hello world!"
}
fn index(req: HttpRequest) -> impl Responder {
"Hello world!"
}
let app = App::new()
.prefix("/app")
.resource("/index.html", |r| r.method(Method::GET).f(index))
.finish()
let app = App::new()
.prefix("/app")
.resource("/index.html", |r| r.method(Method::GET).f(index))
.finish()
// </make_app>
;
}
fn run_server() {
// <run_server>
let server = server::new(|| {
vec![
App::new()
.prefix("/app1")
.resource("/", |r| r.f(|r| HttpResponse::Ok())),
App::new()
.prefix("/app2")
.resource("/", |r| r.f(|r| HttpResponse::Ok())),
App::new().resource("/", |r| r.f(|r| HttpResponse::Ok())),
]
});
let server = server::new(|| {
vec![
App::new()
.prefix("/app1")
.resource("/", |r| r.f(|r| HttpResponse::Ok())),
App::new()
.prefix("/app2")
.resource("/", |r| r.f(|r| HttpResponse::Ok())),
App::new().resource("/", |r| r.f(|r| HttpResponse::Ok())),
]
});
// </run_server>
}