Add NodeInfo endpoints (fixes #11)

This commit is contained in:
Bat
2018-06-10 20:33:42 +01:00
parent 7fd152e270
commit d8bd9dbfca
6 changed files with 72 additions and 4 deletions
+12
View File
@@ -6,6 +6,18 @@ use activity_pub::{ap_url, webfinger::Webfinger};
use db_conn::DbConn;
use models::{blogs::Blog, users::User};
#[get("/.well-known/nodeinfo")]
fn nodeinfo() -> Content<String> {
Content(ContentType::new("application", "jrd+json"), json!({
"links": [
{
"rel": "http://nodeinfo.diaspora.software/ns/schema/2.0",
"href": ap_url(format!("{domain}/nodeinfo", domain = BASE_URL.as_str()))
}
]
}).to_string())
}
#[get("/.well-known/host-meta", format = "application/xml")]
fn host_meta() -> String {
format!(r#"