mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-21 18:23:58 +00:00
feat: Remove Swagger and OpenAPI
Support and features are lacking
This commit is contained in:
@@ -6,18 +6,10 @@ import io.ktor.server.application.*
|
||||
import io.ktor.server.plugins.cachingheaders.*
|
||||
import io.ktor.server.plugins.conditionalheaders.*
|
||||
import io.ktor.server.plugins.cors.routing.*
|
||||
import io.ktor.server.plugins.openapi.*
|
||||
import io.ktor.server.plugins.swagger.*
|
||||
import io.ktor.server.routing.*
|
||||
import kotlin.time.Duration.Companion.minutes
|
||||
|
||||
fun Application.configureHTTP() {
|
||||
install(ConditionalHeaders)
|
||||
routing {
|
||||
swaggerUI(path = "openapi")
|
||||
}
|
||||
routing {
|
||||
openAPI(path = "openapi")
|
||||
}
|
||||
install(CORS) {
|
||||
allowMethod(HttpMethod.Options)
|
||||
allowMethod(HttpMethod.Put)
|
||||
@@ -27,11 +19,8 @@ fun Application.configureHTTP() {
|
||||
anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
|
||||
}
|
||||
install(CachingHeaders) {
|
||||
options { _, outgoingContent ->
|
||||
when (outgoingContent.contentType?.withoutParameters()) {
|
||||
ContentType.Text.CSS -> CachingOptions(CacheControl.MaxAge(maxAgeSeconds = 24 * 60 * 60))
|
||||
else -> null
|
||||
}
|
||||
options { _, _ ->
|
||||
CachingOptions(CacheControl.MaxAge(maxAgeSeconds = 5.minutes.inWholeSeconds.toInt()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user