All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.http4k.contract.ui.swaggerUiLite.kt Maven / Gradle / Ivy

There is a newer version: 5.31.0.0
Show newest version
package org.http4k.contract.ui

import org.http4k.core.then
import org.http4k.routing.ResourceLoader
import org.http4k.routing.routes
import org.http4k.routing.static

/**
 * Serve a "lite" Swagger UI, served by a public CDN
 */
fun swaggerUiLite(configFn: SwaggerUiConfig.() -> Unit = {}) = SwaggerUiConfig()
    .also(configFn)
    .toFilter()
    .then(routes(
        static(ResourceLoader.Classpath("org/http4k/contract/ui/swagger-config/")),
        static(ResourceLoader.Classpath("org/http4k/contract/ui/swagger"))
    ))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy