Use router nesting for local_federation
With 8c787f5, router nesting is supported correctly in axum
This commit is contained in:
parent
8c787f50de
commit
1f6d6c0754
1 changed files with 6 additions and 2 deletions
|
|
@ -29,9 +29,13 @@ pub fn listen(config: &FederationConfig<DatabaseHandle>) -> Result<(), Error> {
|
||||||
let hostname = config.domain();
|
let hostname = config.domain();
|
||||||
info!("Listening with axum on {hostname}");
|
info!("Listening with axum on {hostname}");
|
||||||
let config = config.clone();
|
let config = config.clone();
|
||||||
|
|
||||||
|
let user_router = Router::new()
|
||||||
|
.route("/", get(http_get_user))
|
||||||
|
.route("/inbox", post(http_post_user_inbox));
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/:user/inbox", post(http_post_user_inbox))
|
.nest("/:name", user_router)
|
||||||
.route("/:user", get(http_get_user))
|
|
||||||
.route("/.well-known/webfinger", get(webfinger))
|
.route("/.well-known/webfinger", get(webfinger))
|
||||||
.layer(FederationMiddleware::new(config));
|
.layer(FederationMiddleware::new(config));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue