torrust-index-backend 2.0.0-alpha.3

The backend (API) for the Torrust Index project.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! API routes for the [`settings`](crate::web::api::v1::contexts::settings) API context.
//!
//! Refer to the [API endpoint documentation](crate::web::api::v1::contexts::settings).
use std::sync::Arc;

use axum::routing::get;
use axum::Router;

use super::handlers::{get_all_handler, get_public_handler, get_site_name_handler};
use crate::common::AppData;

/// Routes for the [`category`](crate::web::api::v1::contexts::category) API context.
pub fn router(app_data: Arc<AppData>) -> Router {
    Router::new()
        .route("/", get(get_all_handler).with_state(app_data.clone()))
        .route("/name", get(get_site_name_handler).with_state(app_data.clone()))
        .route("/public", get(get_public_handler).with_state(app_data))
}