mirror of https://github.com/fafhrd91/actix-web
Add links to Resource::default_service. Clarify that a `Route` can be used.
This commit is contained in:
parent
a6f479a6fa
commit
efe87c5bcf
|
@ -312,9 +312,11 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// Default service to be used if no matching route could be found.
|
||||
/// By default *405* response get returned. Resource does not use
|
||||
/// default handler from `App` or `Scope`.
|
||||
/// Default service to be used if no matching route could be found.
|
||||
/// You can pass a [`Route`] as default_service.
|
||||
///
|
||||
/// If no default service is specified, a `405 Method Not Allowed` response will be returned to the caller.
|
||||
/// [`Resource`] does **not** inherit the default handler specified on the parent [`App`](crate::App) or [`Scope`](crate::web::Scope).
|
||||
pub fn default_service<F, U>(mut self, f: F) -> Self
|
||||
where
|
||||
F: IntoServiceFactory<U, ServiceRequest>,
|
||||
|
|
Loading…
Reference in New Issue