get("/cache-time") {
call.respondText(cacheTime, ContentType.Text.Plain, HttpStatusCode.OK)
}
+
+ // Sitemap
+ val sitemapUrls = (listOf(
+ "/",
+ "/about",
+ "/about/pp",
+ "/about/toc",
+ "/info",
+ ) + ShipType.values().map {
+ "/info/${it.toUrlSlug()}"
+ }).map { "https://starshipfights.net$it" }
+
+ val sitemap = sitemapUrls.joinToString(separator = "\n")
+
+ get("/sitemap.txt") {
+ call.respondText(sitemap, ContentType.Text.Plain, HttpStatusCode.OK)
+ }
}
val dataRoutines = DataRoutines.initializeRoutines()
embeddedServer(Netty, port = CurrentConfiguration.port, host = CurrentConfiguration.host) {
+ install(IgnoreTrailingSlash)
install(XForwardedHeaderSupport)
install(CallId) {