forked from alemi/upub
fix: base app Actor, domain stripper
This commit is contained in:
parent
4f4cd5bf9b
commit
1215f49499
2 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,13 @@ pub fn split_id(id: &str) -> (String, String) {
|
||||||
(first.to_string(), last.to_string())
|
(first.to_string(), last.to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn domain(domain: &str) -> String {
|
||||||
|
domain
|
||||||
|
.replace("http://", "")
|
||||||
|
.replace("https://", "")
|
||||||
|
.replace('/', "")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize)]
|
#[derive(Debug, serde::Deserialize)]
|
||||||
// TODO i don't really like how pleroma/mastodon do it actually, maybe change this?
|
// TODO i don't really like how pleroma/mastodon do it actually, maybe change this?
|
||||||
|
|
|
@ -74,6 +74,7 @@ pub async fn serve(db: DatabaseConnection, domain: String) {
|
||||||
// build our application with a single route
|
// build our application with a single route
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
// core server inbox/outbox, maybe for feeds? TODO do we need these?
|
// core server inbox/outbox, maybe for feeds? TODO do we need these?
|
||||||
|
.route("/", get(ap::view))
|
||||||
.route("/inbox", post(ap::inbox))
|
.route("/inbox", post(ap::inbox))
|
||||||
.route("/outbox", get(ap::outbox))
|
.route("/outbox", get(ap::outbox))
|
||||||
// actor routes
|
// actor routes
|
||||||
|
|
Loading…
Reference in a new issue