diff --git a/src/activitypub/mod.rs b/src/activitypub/mod.rs index b25930a5..331d4e21 100644 --- a/src/activitypub/mod.rs +++ b/src/activitypub/mod.rs @@ -19,6 +19,13 @@ pub fn split_id(id: &str) -> (String, String) { (first.to_string(), last.to_string()) } +pub fn domain(domain: &str) -> String { + domain + .replace("http://", "") + .replace("https://", "") + .replace('/', "") +} + #[derive(Debug, serde::Deserialize)] // TODO i don't really like how pleroma/mastodon do it actually, maybe change this? diff --git a/src/server.rs b/src/server.rs index 1ff01e6e..860b410f 100644 --- a/src/server.rs +++ b/src/server.rs @@ -74,6 +74,7 @@ pub async fn serve(db: DatabaseConnection, domain: String) { // build our application with a single route let app = Router::new() // core server inbox/outbox, maybe for feeds? TODO do we need these? + .route("/", get(ap::view)) .route("/inbox", post(ap::inbox)) .route("/outbox", get(ap::outbox)) // actor routes