diff options
Diffstat (limited to 'crates/configuration/src/server/http_svc')
3 files changed, 45 insertions, 0 deletions
diff --git a/crates/configuration/src/server/http_svc/routes.rs b/crates/configuration/src/server/http_svc/routes.rs new file mode 100644 index 0000000..cc065e8 --- /dev/null +++ b/crates/configuration/src/server/http_svc/routes.rs @@ -0,0 +1,11 @@ +mod routing; + +use utoipa_axum::{router::OpenApiRouter, routes}; + +use crate::state::AppHandle; + +pub fn router(store: AppHandle) -> OpenApiRouter { + OpenApiRouter::new() + .routes(routes!(routing::get_active)) + .with_state(store) +} diff --git a/crates/configuration/src/server/http_svc/routes/routing.rs b/crates/configuration/src/server/http_svc/routes/routing.rs new file mode 100644 index 0000000..7c8affe --- /dev/null +++ b/crates/configuration/src/server/http_svc/routes/routing.rs @@ -0,0 +1,4 @@ +//pub mod delete_routing; +pub mod get_active; +//pub mod post_routing; +//pub mod replace_routing; diff --git a/crates/configuration/src/server/http_svc/routes/routing/get_active.rs b/crates/configuration/src/server/http_svc/routes/routing/get_active.rs new file mode 100644 index 0000000..562a1f1 --- /dev/null +++ b/crates/configuration/src/server/http_svc/routes/routing/get_active.rs @@ -0,0 +1,30 @@ +use axum::{extract::State, response::IntoResponse}; +use warden_core::configuration::routing::RoutingConfiguration; + +use crate::{ + server::{error::AppError, http_svc::TAG_ROUTING, version::Version}, + state::AppHandle, +}; + +#[utoipa::path( + get, + responses(( + status = OK, + body = RoutingConfiguration + )), + operation_id = "get_active_routing", // https://github.com/juhaku/utoipa/issues/1170 + path = "/{version}/routing", + params( + ("version" = Version, Path, description = "API version, e.g., v1, v2, v3") + ), + tag = TAG_ROUTING, + ) +] +#[axum::debug_handler] +#[tracing::instrument(skip(state), err(Debug), fields(method = "GET"))] +pub(super) async fn active_routing( + version: Version, + State(state): State<AppHandle>, +) -> Result<impl IntoResponse, AppError> { + Ok(String::default().into_response()) +} |