From 7fd0ab17621aeaeffaeaef39eaca50fa0fdd24cc Mon Sep 17 00:00:00 2001 From: ChuYong Date: Sat, 15 Jun 2024 23:36:03 +0900 Subject: [PATCH] docs: apply swagger with msa --- api-gateway/build.gradle.kts | 3 +- .../src/main/resources/application.properties | 1 - .../src/main/resources/application.yaml | 29 +++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) delete mode 100644 api-gateway/src/main/resources/application.properties create mode 100644 api-gateway/src/main/resources/application.yaml diff --git a/api-gateway/build.gradle.kts b/api-gateway/build.gradle.kts index cd22398..bbe703d 100644 --- a/api-gateway/build.gradle.kts +++ b/api-gateway/build.gradle.kts @@ -21,8 +21,9 @@ repositories { extra["springCloudVersion"] = "2023.0.2" dependencies { - implementation("org.springframework.boot:spring-boot-starter-security") + //implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.cloud:spring-cloud-starter-gateway") + implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:2.5.0") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("io.projectreactor:reactor-test") testImplementation("org.springframework.security:spring-security-test") diff --git a/api-gateway/src/main/resources/application.properties b/api-gateway/src/main/resources/application.properties deleted file mode 100644 index 292ca05..0000000 --- a/api-gateway/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -spring.application.name=api-gateway diff --git a/api-gateway/src/main/resources/application.yaml b/api-gateway/src/main/resources/application.yaml new file mode 100644 index 0000000..ab75025 --- /dev/null +++ b/api-gateway/src/main/resources/application.yaml @@ -0,0 +1,29 @@ +spring: + application: + name: api-gateway + cloud: + gateway: + routes: + - id: user-service + uri: https://user-service.mafoo.kr + predicates: + - Path=/user/** + - Method=GET + filters: + - RewritePath=/user/(?/?.*), /$\{segment} + - id: photo-service + uri: https://photo-service.mafoo.kr + predicates: + - Path=/photo/** + - Method=GET + filters: + - RewritePath=/photo/(?/?.*), /$\{segment} +springdoc: + swagger-ui: + urls[0]: + name: "유저 서비스" + url: https://gating.mafoo.kr/user/v3/api-docs + + urls[1]: + name: "사진 서비스" + url: https://gating.mafoo.kr/photo/v3/api-docs