Skip to content

Commit

Permalink
keep both ways to show swagger api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
bingzhang committed Dec 1, 2023
1 parent cd1dd58 commit 8842042
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class Application @Inject()(files: FileService, collections: CollectionService,
def swaggerUI = Action { implicit request =>
val swagger = routes.Application.swagger().absoluteURL(Utils.https(request))
val swaggerUIHost = play.Play.application().configuration().getString("swaggerUIHost")
if (swaggerUIHost != null) {
Redirect(swaggerUIHost)
if (swaggerUIHost == null) {
Redirect("http://clowder.ncsa.illinois.edu/swagger/?url=" + swagger)
} else {
NotFound("Could not find swagger ui host")
Redirect(swaggerUIHost)
}
}

Expand Down
5 changes: 5 additions & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ clowder.license {
download=false
}

# swagger api doc host
# if no setting of swaggerUIHost, it will use https://clowder.ncsa.illinois.edu/swagger to show the swagger api doc.
# otherwise, you can point `swaggerUIHost` to your swagger-ui url to show the swagger api doc.
swaggerUIHost="http://localhost:8082"

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Space related information
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 8842042

Please sign in to comment.