Skip to content

Commit

Permalink
Update the URL to access Swagger UI
Browse files Browse the repository at this point in the history
  • Loading branch information
yunkon-kim committed Apr 1, 2024
1 parent a8184e7 commit 893ba08
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/api/rest/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ func RunServer(port string) {
//e.colorer.Printf(banner, e.colorer.Red("v"+Version), e.colorer.Blue(website))

// Route for system management
e.GET("/tumblebug/swagger/*", echoSwagger.WrapHandler)
swaggerRedirect := func(c echo.Context) error {
return c.Redirect(http.StatusMovedPermanently, "/tumblebug/api/index.html")
}
e.GET("/tumblebug/api", swaggerRedirect)
e.GET("/tumblebug/api/", swaggerRedirect)
e.GET("/tumblebug/api/*", echoSwagger.WrapHandler)

// e.GET("/tumblebug/swagger/*", echoSwagger.WrapHandler)
// e.GET("/tumblebug/swaggerActive", rest_common.RestGetSwagger)
e.GET("/tumblebug/health", rest_common.RestGetHealth)
e.GET("/tumblebug/httpVersion", rest_common.RestCheckHTTPVersion)
Expand Down Expand Up @@ -421,7 +428,7 @@ func RunServer(port string) {
g.GET("/:nsId/testGetAssociatedObjectCount/:resourceType/:resourceId", rest_mcir.RestTestGetAssociatedObjectCount)

selfEndpoint := os.Getenv("SELF_ENDPOINT")
apidashboard := " http://" + selfEndpoint + "/tumblebug/swagger/"
apidashboard := " http://" + selfEndpoint + "/tumblebug/api/index.html"

if enableAuth {
fmt.Println(" Access to API dashboard" + " (username: " + apiUser + " / password: " + apiPass + ")")
Expand Down

0 comments on commit 893ba08

Please sign in to comment.