pl.touk.nussknacker.engine.requestresponse.SwaggerUiRoute.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nussknacker-request-response-runtime_2.12 Show documentation
Show all versions of nussknacker-request-response-runtime_2.12 Show documentation
nussknacker-request-response-runtime
package pl.touk.nussknacker.engine.requestresponse
import akka.http.scaladsl.server.{Directives, Route}
import com.typesafe.scalalogging.LazyLogging
object SwaggerUiRoute extends Directives with LazyLogging {
val route: Route = {
pathPrefix("swagger-ui") {
get {
encodeResponse {
pathEndOrSingleSlash {
getFromResource("swagger-ui/index.html")
} ~ getFromResourceDirectory(s"swagger-ui")
}
}
}
}
}