feat: use custom middleware for authorization
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful

This commit is contained in:
Radical 2025-07-20 14:12:57 +02:00
parent dada230e08
commit 1ad88725bd
24 changed files with 157 additions and 365 deletions

View file

@ -2,15 +2,15 @@
use std::sync::Arc;
use axum::{Router, routing::get};
use axum::{routing::get, Router};
use crate::AppState;
mod v1;
mod versions;
pub fn router(path: &str) -> Router<Arc<AppState>> {
pub fn router(path: &str, app_state: Arc<AppState>) -> Router<Arc<AppState>> {
Router::new()
.route(&format!("{path}/versions"), get(versions::versions))
.nest(&format!("{path}/v1"), v1::router())
.nest(&format!("{path}/v1"), v1::router(app_state))
}