mirror of
https://github.com/actix/actix-website
synced 2024-11-24 00:41:07 +01:00
Outdent examples
This commit is contained in:
parent
be72dac069
commit
ede773dd93
@ -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>
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user