Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SASC
sentinel-legacy
Commits
f84b8a20
Commit
f84b8a20
authored
Jun 30, 2015
by
bow
Browse files
Rename api-docs endpoint to api-spec
parent
f5280322
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/it/scala/nl/lumc/sasc/sentinel/api/RootControllerSpec.scala
View file @
f84b8a20
...
...
@@ -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
{
...
...
src/main/scala/ScalatraBootstrap.scala
View file @
f84b8a20
...
...
@@ -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
()
...
...
src/main/scala/nl/lumc/sasc/sentinel/api/RootController.scala
View file @
f84b8a20
...
...
@@ -39,8 +39,8 @@ class RootController extends ScalatraServlet
response
.
setHeader
(
"Access-Control-Allow-Methods"
,
"GET,HEAD"
)
}
/** Root endpoint, which permanently redirects to our
document
ation. */
/** Root endpoint, which permanently redirects to our
specific
ation. */
get
(
"/"
)
{
halt
(
status
=
301
,
headers
=
Map
(
"Location"
->
"/api-
docs
"
))
halt
(
status
=
301
,
headers
=
Map
(
"Location"
->
"/api-
spec
"
))
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment