refactor(bootstrap): use ap_service.router() as single source of truth for AP routes
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user