1
use axum::{routing, Router};
2

            
3
use super::super::{middleware::AuthService, State};
4

            
5
mod api;
6
mod request;
7
mod response;
8

            
9
1263
pub fn new_service(scope_path: &str, state: &State) -> Router {
10
1263
    let auth_uri = format!("{}/api/v1/auth/tokeninfo", state.auth_base.as_str());
11
1263
    Router::new().nest(
12
1263
        scope_path,
13
1263
        Router::new()
14
1263
            .route(
15
1263
                "/count",
16
1263
                routing::get(api::get_count).layer(AuthService::new(auth_uri.clone())),
17
1263
            )
18
1263
            .route(
19
1263
                "/list",
20
1263
                routing::get(api::get_list).layer(AuthService::new(auth_uri.clone())),
21
1263
            )
22
1263
            .with_state(state.clone()),
23
1263
    )
24
1263
}