Vojtěch Knyttl
03/29/2021, 8:54 PMroutes(
"/docs/swagger-ui/swagger-ui.css" bind static(Classpath("/swagger-ui/swagger-ui.css")), // read from src/main/resources
"/docs" bind static(Classpath("META-INF/resources/webjars/swagger-ui/3.25.2"))
basically I want to override the single swagger-ui.css
file and leave the rest of swagger tools as default.
with the example above, the file is ignored and only content from the swagger-ui webjars is served.dave
03/30/2021, 1:28 PM/swagger-ui/swagger-ui.css/docs/swagger-ui/swagger-ui.css
.dave
03/30/2021, 1:29 PMClasspath()
Vojtěch Knyttl
03/30/2021, 1:29 PMVojtěch Knyttl
03/30/2021, 1:29 PMVojtěch Knyttl
03/30/2021, 6:13 PM"/docs" bind static(Classpath("/docs")),
but once I add the file, it immediately gets to 404Vojtěch Knyttl
03/30/2021, 6:14 PMVojtěch Knyttl
03/30/2021, 6:14 PM"/docs" bind static(Classpath()),
does not workdave
03/30/2021, 7:30 PMfun main() {
val app = routes(
override("/org/index.html", "/"),
static(Classpath("/bar"))
)
println("1" + app(Request(GET, "/org/index.html")).bodyString())
println("2" + app(Request(GET, "/index.html")).bodyString())
}
private fun override(resource: String, root: String) = resource bind { r: Request ->
Response(OK).body(Classpath(root).load(resource.drop(1))!!.openStream())
}
Vojtěch Knyttl
03/31/2021, 6:17 AM