You've already forked authentication-service
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user