Merge pull request #212 from zcdunn/add_webapp_manifest
Add webapp manifest
This commit is contained in:
@@ -76,6 +76,7 @@ fn main() {
|
||||
routes::instance::shared_inbox,
|
||||
routes::instance::nodeinfo,
|
||||
routes::instance::about,
|
||||
routes::instance::web_manifest,
|
||||
|
||||
routes::likes::create,
|
||||
routes::likes::create_auth,
|
||||
|
||||
@@ -244,3 +244,17 @@ fn about(user: Option<User>, conn: DbConn) -> Template {
|
||||
"n_instances": Instance::count(&*conn) - 1
|
||||
}))
|
||||
}
|
||||
|
||||
#[get("/manifest.json")]
|
||||
fn web_manifest(conn: DbConn) -> Json<serde_json::Value> {
|
||||
let instance = Instance::get_local(&*conn).unwrap();
|
||||
Json(json!({
|
||||
"name": &instance.name,
|
||||
"description": &instance.short_description,
|
||||
"start_url": String::from("/"),
|
||||
"scope": String::from("/"),
|
||||
"display": String::from("standalone"),
|
||||
"background_color": String::from("#f4f4f4"),
|
||||
"theme_color": String::from("#7765e3")
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user