serve manifest.json without nginx

pull/5761/head
Niklas Fiekas 2019-12-14 08:56:45 +01:00
parent 8c8b71da44
commit 439330f096
3 changed files with 32 additions and 45 deletions

View File

@ -124,6 +124,37 @@ Disallow: /games/export
}
}
def manifest = Action { req =>
Ok {
Json.obj(
"name" -> env.net.domain.value,
"short_name" -> "Lichess",
"start_url" -> "/",
"display" -> "standalone",
"background_color" -> "#161512",
"theme_color" -> "#161512",
"description" -> "The (really) free, no-ads, open source chess server.",
"icons" -> List(32, 64, 128, 192, 256, 512, 1024).map { size =>
Json.obj(
"src" -> s"//${env.net.assetDomain.value}/assets/logo/lichess-favicon-$size.png",
"sizes" -> s"${size}x${size}",
"type" -> "image/png"
)
},
"related_applications" -> Json.arr(
Json.obj(
"platform" -> "play",
"url" -> "https://play.google.com/store/apps/details?id=org.lichess.mobileapp"
),
Json.obj(
"platform" -> "itunes",
"url" -> "https://itunes.apple.com/us/app/lichess-free-online-chess/id968371784"
)
)
)
} as JSON withHeaders (CACHE_CONTROL -> "max-age=1209600")
}
def getFishnet = Open { implicit ctx =>
Ok(html.site.bits.getFishnet()).fuccess
}

View File

@ -605,6 +605,7 @@ GET /swag controllers.Main.movedPermanently(to: Str
GET /assets/_$v<\w{6}>/*file controllers.Main.devAsset(v, path="public", file)
GET /assets/*file controllers.ExternalAssets.at(path="public", file)
GET /manifest.json controllers.Main.manifest
GET /robots.txt controllers.Main.robots
OPTIONS / controllers.Options.root

View File

@ -1,45 +0,0 @@
{
"name": "lichess.org",
"short_name": "Lichess",
"start_url": "/",
"display": "standalone",
"background_color": "#161512",
"theme_color": "#161512",
"description": "The (really) free, no-ads, open source chess server.",
"icons": [{
"src": "https://lichess1.org/assets/logo/lichess-favicon-32.png",
"sizes": "32x32",
"type": "image/png"
}, {
"src": "https://lichess1.org/assets/logo/lichess-favicon-64.png",
"sizes": "64x64",
"type": "image/png"
}, {
"src": "https://lichess1.org/assets/logo/lichess-favicon-128.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "https://lichess1.org/assets/logo/lichess-favicon-192.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "https://lichess1.org/assets/logo/lichess-favicon-256.png",
"sizes": "256x256",
"type": "image/png"
}, {
"src": "https://lichess1.org/assets/logo/lichess-favicon-512.png",
"sizes": "512x512",
"type": "image/png"
}, {
"src": "https://lichess1.org/assets/logo/lichess-favicon-1024.png",
"sizes": "1024x1024",
"type": "image/png"
}],
"related_applications": [{
"platform": "play",
"url": "https://play.google.com/store/apps/details?id=org.lichess.mobileapp"
}, {
"platform": "itunes",
"url": "https://itunes.apple.com/us/app/lichess-free-online-chess/id968371784"
}]
}