diff --git a/.github/workflows/dev-CI.yml b/.github/workflows/dev-CI.yml index 457af248..3776a7c6 100644 --- a/.github/workflows/dev-CI.yml +++ b/.github/workflows/dev-CI.yml @@ -56,6 +56,7 @@ jobs: DEV_ACCESS_TOKEN_EXPIRE_TIME: ${{ secrets.DEV_ACCESS_TOKEN_EXPIRE_TIME }} DEV_REFRESH_TOKEN_EXPIRE_TIME: ${{ secrets.DEV_REFRESH_TOKEN_EXPIRE_TIME }} DEV_ALLOWED_ORIGINS: ${{ secrets.DEV_ALLOWED_ORIGINS }} + DEV_SERVER_URL: ${{ secrets.DEV_SERVER_URL }} run: | cd ./src/main/resources envsubst < application-dev.yml > application-dev.tmp.yml && mv application-dev.tmp.yml application-dev.yml diff --git a/.github/workflows/prod-CI.yml b/.github/workflows/prod-CI.yml index 0b5e9e8c..7af7a03e 100644 --- a/.github/workflows/prod-CI.yml +++ b/.github/workflows/prod-CI.yml @@ -56,6 +56,7 @@ jobs: PROD_ACCESS_TOKEN_EXPIRE_TIME: ${{ secrets.PROD_ACCESS_TOKEN_EXPIRE_TIME }} PROD_REFRESH_TOKEN_EXPIRE_TIME: ${{ secrets.PROD_REFRESH_TOKEN_EXPIRE_TIME }} PROD_ALLOWED_ORIGINS: ${{ secrets.PROD_ALLOWED_ORIGINS }} + PROD_SERVER_URL: ${{ secrets.PROD_SERVER_URL }} run: | cd ./src/main/resources envsubst < application-prod.yml > application-prod.tmp.yml && mv application-prod.tmp.yml application-prod.yml diff --git a/src/main/java/com/beat/global/swagger/SwaggerConfig.java b/src/main/java/com/beat/global/swagger/SwaggerConfig.java index 3357edfc..f3ffc34b 100644 --- a/src/main/java/com/beat/global/swagger/SwaggerConfig.java +++ b/src/main/java/com/beat/global/swagger/SwaggerConfig.java @@ -6,11 +6,17 @@ import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; + +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class SwaggerConfig { + + @Value("${app.server.url}") + private String serverUrl; + @Bean public OpenAPI openAPI() { String jwt = "JWT"; @@ -21,7 +27,7 @@ public OpenAPI openAPI() { .scheme("bearer") .bearerFormat("JWT") ); - return new OpenAPI().addServersItem(new Server().url("/")) + return new OpenAPI().addServersItem(new Server().url(serverUrl)) .components(new Components()) .info(apiInfo()) .addSecurityItem(securityRequirement) @@ -31,6 +37,6 @@ private Info apiInfo() { return new Info() .title("BEAT Project API") .description("간편하게 소규모 공연을 등록하고 관리할 수 있는 티켓 예매 플랫폼") - .version("1.0.1"); + .version("1.1.0"); } } \ No newline at end of file diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 13b5a796..e9d0c438 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -76,4 +76,8 @@ logging: root: info # 추후 debug로 변경 cors: - allowed-origins: ${DEV_ALLOWED_ORIGINS} \ No newline at end of file + allowed-origins: ${DEV_ALLOWED_ORIGINS} + +app: + server: + url: ${DEV_SERVER_URL} \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 8cdb46cb..c9689bd2 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -76,4 +76,8 @@ logging: root: info cors: - allowed-origins: ${PROD_ALLOWED_ORIGINS} \ No newline at end of file + allowed-origins: ${PROD_ALLOWED_ORIGINS} + +app: + server: + url: ${PROD_SERVER_URL} \ No newline at end of file