refactor(bootstrap): use ap_service.router() as single source of truth for AP routes

This commit is contained in:
2026-05-15 11:47:37 +02:00
parent a8caca8df8
commit bd1dd89f78
2 changed files with 8 additions and 38 deletions

View File

@@ -261,7 +261,13 @@ impl ActivityPubService {
Ok(serde_json::to_string(&WithContext::new_default(person))?)
}
pub fn router(&self) -> Router {
/// Returns the ActivityPub router compatible with any outer state `S`.
/// Handlers only use `Data<FederationData>` injected by the middleware layer,
/// so the router is independent of the application state type.
pub fn router<S>(&self) -> Router<S>
where
S: Clone + Send + Sync + 'static,
{
Router::new()
.route("/.well-known/nodeinfo", get(nodeinfo_well_known_handler))
.route("/nodeinfo/2.0", get(nodeinfo_handler))