Commit f84b8a20 authored by bow's avatar bow
Browse files

Rename api-docs endpoint to api-spec

parent f5280322
......@@ -26,7 +26,7 @@ class RootControllerSpec extends SentinelServletSpec with Mockito {
implicit val system = mock[ActorSystem]
implicit val swagger = new SentinelSwagger
addServlet(new RootController, s"/*")
addServlet(new ResourcesApp, "/api-docs/*")
addServlet(new ResourcesApp, "/api-spec/*")
"OPTIONS '/'" >> {
br
......@@ -48,8 +48,8 @@ class RootControllerSpec extends SentinelServletSpec with Mockito {
priorResponse.status mustEqual 301
}
"redirect to /api-docs" in {
priorResponse.header("Location") must endWith("/api-docs")
"redirect to /api-spec" in {
priorResponse.header("Location") must endWith("/api-spec")
}
"return an empty body" in {
......@@ -58,9 +58,9 @@ class RootControllerSpec extends SentinelServletSpec with Mockito {
}
}
"GET '/api-docs' should" >> inline {
"GET '/api-spec' should" >> inline {
val endpoint = "/api-docs"
val endpoint = "/api-spec"
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 ResourcesApp, "/api-docs/*")
context mount (new ResourcesApp, "/api-spec/*")
context setInitParameter (org.scalatra.EnvironmentKey, env)
} catch {
case e: Throwable => e.printStackTrace()
......
......@@ -39,8 +39,8 @@ class RootController extends ScalatraServlet
response.setHeader("Access-Control-Allow-Methods", "GET,HEAD")
}
/** Root endpoint, which permanently redirects to our documentation. */
/** Root endpoint, which permanently redirects to our specification. */
get("/") {
halt(status = 301, headers = Map("Location" -> "/api-docs"))
halt(status = 301, headers = Map("Location" -> "/api-spec"))
}
}
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