2 use crate::settings::Settings;
5 pub fn config(cfg: &mut web::ServiceConfig) {
6 if Settings::get().federation.enabled {
7 println!("federation enabled, host is {}", Settings::get().hostname);
10 "/federation/communities",
11 web::get().to(apub::community::get_apub_community_list),
13 // TODO: this needs to be moved to the actors (eg /federation/u/{}/inbox)
14 .route("/federation/inbox", web::post().to(apub::inbox::inbox))
16 "/federation/c/{_}/inbox",
17 web::post().to(apub::inbox::inbox),
20 "/federation/u/{_}/inbox",
21 web::post().to(apub::inbox::inbox),
24 "/federation/c/{community_name}",
25 web::get().to(apub::community::get_apub_community_http),
28 "/federation/c/{community_name}/followers",
29 web::get().to(apub::community::get_apub_community_followers),
32 "/federation/c/{community_name}/outbox",
33 web::get().to(apub::community::get_apub_community_outbox),
36 "/federation/u/{user_name}",
37 web::get().to(apub::user::get_apub_user),
40 "/federation/p/{post_id}",
41 web::get().to(apub::user::get_apub_user),