Commit 0664f861 authored by bow's avatar bow
Browse files

Rename /api-spec -> /api-specs and set URL detection in docs page correctly

parent a00812ff
......@@ -27,7 +27,7 @@ class RootControllerSpec extends SentinelServletSpec with Mockito {
implicit val swagger = new SentinelSwagger
addServlet(new RootController, s"/*")
addServlet(new ApiDocsController, "/api-docs/*")
addServlet(new ApiSpecsController, "/api-spec/*")
addServlet(new ApiSpecsController, "/api-specs/*")
"OPTIONS '/'" >> {
br
......@@ -59,9 +59,9 @@ class RootControllerSpec extends SentinelServletSpec with Mockito {
}
}
"GET '/api-spec' should" >> inline {
"GET '/api-specs' should" >> inline {
val endpoint = "/api-spec"
val endpoint = "/api-specs"
new Context.PriorRequests {
......
......@@ -80,7 +80,7 @@ class ScalatraBootstrap extends LifeCycle {
context mount (new AnnotationsController, "/annotations/*")
context mount (new RunsController, "/runs/*")
context mount (new UsersController, "/users/*")
context mount (new ApiSpecsController, "/api-spec/*")
context mount (new ApiSpecsController, "/api-specs/*")
context mount (new ApiDocsController, "/api-docs/*")
context setInitParameter (org.scalatra.EnvironmentKey, env)
} catch {
......
......@@ -27,7 +27,7 @@
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
url = window.location.href.replace("api-docs", "api-spec");
url = window.location.origin + "/api-specs";
}
window.swaggerUi = new SwaggerUi({
url: url,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment