From 9a404c2284fc623ab84dfba359881b7fa3db8506 Mon Sep 17 00:00:00 2001 From: Seokho Son Date: Wed, 27 Mar 2024 15:03:56 +0900 Subject: [PATCH] Revert API path for Swagger UI to fix err --- README.md | 4 ++-- i18n/README-EN.md | 4 ++-- src/api/rest/server/server.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d6df6adc..c319b1cc 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ Check out [CONTRIBUTING](https://github.com/cloud-barista/cb-tumblebug/blob/main - Swagger API 문서 업데이트 필요 시 `cb-tumblebug/src/` 에서 `make swag` 실행 - API 문서 파일은 `cb-tumblebug/src/api/rest/docs/swagger.yaml` 에 생성됨 - - 해당 API 문서는 http://localhost:1323/tumblebug/api 로컬에서 웹브라우저로 확인 가능 (CB-Tumblebug 구동 시 자동으로 제공) + - 해당 API 문서는 http://localhost:1323/tumblebug/swagger/ 로컬에서 웹브라우저로 확인 가능 (CB-Tumblebug 구동 시 자동으로 제공) - Swagger 기반 [API 문서 업데이트 방법 상세 정보](https://github.com/cloud-barista/cb-tumblebug/wiki/API-Document-Update) ### (3) CB-Tumblebug 실행 @@ -263,7 +263,7 @@ Check out [CONTRIBUTING](https://github.com/cloud-barista/cb-tumblebug/blob/main Access to API dashboard (username: default / password: default) - http://xxx.xxx.xxx.xxx:1323/tumblebug/api + http://xxx.xxx.xxx.xxx:1323/tumblebug/swagger/ ⇨ http server started on [::]:1323 ``` diff --git a/i18n/README-EN.md b/i18n/README-EN.md index 505fe2d1..20172116 100644 --- a/i18n/README-EN.md +++ b/i18n/README-EN.md @@ -166,7 +166,7 @@ Check out [CONTRIBUTING](https://github.com/cloud-barista/cb-tumblebug/blob/main - If Swagger API Document needs to be updated run `make swag` at `cb-tumblebug/src/` directory. - API document file is created at `cb-tumblebug/src/api/rest/docs/swagger.yaml` directory. - - Following API document can be checked on http://localhost:1323/tumblebug/api through web browser. (Automatically provided when CB-Tumblebug is executed) + - Following API document can be checked on http://localhost:1323/tumblebug/swagger/ through web browser. (Automatically provided when CB-Tumblebug is executed) ### (3) Run CB-Tumblebug - Run [CB-Spider](https://github.com/cloud-barista/cb-spider) in another tab @@ -196,7 +196,7 @@ Check out [CONTRIBUTING](https://github.com/cloud-barista/cb-tumblebug/blob/main Access to API dashboard (username: default / password: default) - http://xxx.xxx.xxx.xxx:1323/tumblebug/api + http://xxx.xxx.xxx.xxx:1323/tumblebug/swagger/ ⇨ http server started on [::]:1323 ``` diff --git a/src/api/rest/server/server.go b/src/api/rest/server/server.go index ddb65ae7..186c7665 100644 --- a/src/api/rest/server/server.go +++ b/src/api/rest/server/server.go @@ -102,7 +102,7 @@ func RunServer(port string) { //e.colorer.Printf(banner, e.colorer.Red("v"+Version), e.colorer.Blue(website)) // Route for system management - 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) @@ -415,7 +415,7 @@ func RunServer(port string) { g.GET("/:nsId/testGetAssociatedObjectCount/:resourceType/:resourceId", rest_mcir.RestTestGetAssociatedObjectCount) selfEndpoint := os.Getenv("SELF_ENDPOINT") - apidashboard := " http://" + selfEndpoint + "/tumblebug/api" + apidashboard := " http://" + selfEndpoint + "/tumblebug/swagger/" if enableAuth { fmt.Println(" Access to API dashboard" + " (username: " + apiUser + " / password: " + apiPass + ")")