From 8a9f076d826cb93dcce292180de6fc2be66a7872 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 17 Jan 2025 13:57:58 +0100 Subject: feat(openapi): Add openapi method routes --- server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/core/src') diff --git a/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt b/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt index 0f13606..56492db 100644 --- a/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt +++ b/server/core/src/main/kotlin/moe/nea/ledger/server/core/Application.kt @@ -6,6 +6,8 @@ import io.ktor.server.application.install import io.ktor.server.netty.EngineMain import io.ktor.server.plugins.compression.Compression import io.ktor.server.plugins.contentnegotiation.ContentNegotiation +import io.ktor.server.response.respondRedirect +import io.ktor.server.routing.get import io.ktor.server.routing.route import io.ktor.server.routing.routing import kotlinx.serialization.json.Json @@ -43,6 +45,7 @@ fun Application.module() { routing { route("/api") { this.apiRouting(database) + get { call.respondRedirect("/openapi/") } } route("/api.json") { openApiDocsJson() -- cgit