fix: spec and docs behind auth (#284)

This commit is contained in:
Ryan Brink
2022-08-13 10:34:01 -07:00
committed by GitHub
parent 90b1f47dbb
commit 2e29b46f0f
4 changed files with 119 additions and 12 deletions

View File

@ -3,7 +3,7 @@ package io.bkbn.kompendium.core.routes
import io.ktor.http.HttpStatusCode
import io.ktor.server.application.call
import io.ktor.server.html.respondHtml
import io.ktor.server.routing.Routing
import io.ktor.server.routing.Route
import io.ktor.server.routing.get
import io.ktor.server.routing.route
import kotlinx.html.body
@ -20,7 +20,7 @@ import kotlinx.html.unsafe
* @param pageTitle Webpage title you wish to be displayed on your docs
* @param specUrl url to point ReDoc to the OpenAPI json document
*/
fun Routing.redoc(pageTitle: String = "Docs", specUrl: String = "/openapi.json") {
fun Route.redoc(pageTitle: String = "Docs", specUrl: String = "/openapi.json") {
route("/docs") {
get {
call.respondHtml(HttpStatusCode.OK) {