feat: use custom middleware for authorization
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
This commit is contained in:
parent
dada230e08
commit
1ad88725bd
24 changed files with 157 additions and 365 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue