aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz')
-rw-r--r--src/main/scala/xyz/driver/core/init/HttpApi.scala2
-rw-r--r--src/main/scala/xyz/driver/core/rest/Swagger.scala8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/core/init/HttpApi.scala b/src/main/scala/xyz/driver/core/init/HttpApi.scala
index e7d975a..6330fbe 100644
--- a/src/main/scala/xyz/driver/core/init/HttpApi.scala
+++ b/src/main/scala/xyz/driver/core/init/HttpApi.scala
@@ -46,7 +46,7 @@ trait HttpApi extends CloudServices with Directives with SprayJsonSupport { self
config,
reporter
)
- generator.routes ~ generator.swaggerUI
+ generator.routes ~ generator.swaggerUINew
}
private def cors(inner: Route): Route =
diff --git a/src/main/scala/xyz/driver/core/rest/Swagger.scala b/src/main/scala/xyz/driver/core/rest/Swagger.scala
index b598b33..786e2d7 100644
--- a/src/main/scala/xyz/driver/core/rest/Swagger.scala
+++ b/src/main/scala/xyz/driver/core/rest/Swagger.scala
@@ -124,4 +124,12 @@ class Swagger(
"title" -> config.getString("swagger.apiInfo.title"))
} ~ getFromResourceDirectory("swagger-ui")
+ def swaggerUINew: Route =
+ pathEndOrSingleSlash {
+ getTemplatedResource(
+ "swagger-ui-dist/index.html",
+ ContentTypes.`text/html(UTF-8)`,
+ "title" -> config.getString("swagger.apiInfo.title"))
+ } ~ getFromResourceDirectory("swagger-ui-dist")
+
}