1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Allow running the authentication service on a different base path

This commit is contained in:
Quentin Gliech
2023-09-05 17:51:50 +02:00
parent 9ecb666ec1
commit 9b5c8fb44b
40 changed files with 388 additions and 195 deletions

View File

@@ -175,6 +175,7 @@ fn on_http_response_labels<B>(res: &Response<B>) -> Vec<KeyValue> {
pub fn build_router<B>(
state: AppState,
resources: &[HttpResource],
prefix: Option<&str>,
name: Option<&str>,
) -> Router<(), B>
where
@@ -244,6 +245,11 @@ where
}
}
if let Some(prefix) = prefix {
let path = format!("{}/", prefix.trim_end_matches('/'));
router = Router::new().nest(&path, router);
}
router = router.fallback(mas_handlers::fallback);
router