diff --git a/content/docs/application.md b/content/docs/application.md index bba4121..9def9ed 100644 --- a/content/docs/application.md +++ b/content/docs/application.md @@ -108,13 +108,7 @@ The result of the above example would be: /app -> "app" /api/test -> "test" ``` -Each `ServiceConfig` can have it's own `data`, `routes`, and `services` - -It is also possible to create application object in separate function. -`App` type uses complex generics and result type have to use `impl Trait` feature. -This could be useful for unit tests. - -{{< include-example example="application" file="config_app.rs" section="config" >}} +Each [`ServiceConfig`][serviceconfig] can have it's own `data`, `routes`, and `services`. [usingappprefix]: /docs/url-dispatch/index.html#using-an-application-prefix-to-compose-applications [stateexample]: https://github.com/actix/examples/blob/master/state/src/main.rs @@ -129,3 +123,4 @@ This could be useful for unit tests. [webscopeconfig]: https://docs.rs/actix-web/2/actix_web/struct.Scope.html#method.configure [webscope]: https://docs.rs/actix-web/2/actix_web/web/fn.scope.html [urlfor]: https://docs.rs/actix-web/2/actix_web/struct.HttpRequest.html#method.url_for +[serviceconfig]: https://docs.rs/actix-web/2/actix_web/web/struct.ServiceConfig.html diff --git a/examples/application/src/config_app.rs b/examples/application/src/config_app.rs deleted file mode 100644 index f75fd94..0000000 --- a/examples/application/src/config_app.rs +++ /dev/null @@ -1,20 +0,0 @@ -// -use actix_service::ServiceFactory; -use actix_web::dev::{MessageBody, ServiceRequest, ServiceResponse}; -use actix_web::{web, App, Error, HttpResponse}; - -fn create_app() -> App< - impl ServiceFactory< - Config = (), - Request = ServiceRequest, - Response = ServiceResponse, - Error = Error, - >, - impl MessageBody, -> { - App::new().service( - web::scope("/app") - .route("/index.html", web::get().to(|| HttpResponse::Ok())), - ) -} -// diff --git a/examples/application/src/main.rs b/examples/application/src/main.rs index 983609c..d1a7afa 100644 --- a/examples/application/src/main.rs +++ b/examples/application/src/main.rs @@ -3,7 +3,6 @@ use actix_web::{web, App, HttpResponse, HttpServer}; pub mod app; pub mod combine; pub mod config; -pub mod config_app; pub mod scope; pub mod state; pub mod vh;