Skip to main content

get_root_router_autoinject

Function get_root_router_autoinject 

Source
pub fn get_root_router_autoinject<T: GenericSetup + Send + Sync + Clone + 'static>(
    app_state: &GenericServerState,
    app_config: T,
) -> Router
Expand description

Returns preconfigured router with app state and OpenTelemetry metrics injected.

To get your app_config inside handler/endpoint, call depot.obtain::<YourAppConfigType>().unwrap().