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