Skip to content

Commit

Permalink
Fix: staging 환경 domain url 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
BYEONGRYEOL committed Aug 5, 2024
1 parent fcd6974 commit aa2e14c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -18,12 +19,17 @@ public class SwaggerConfig {
private final String BEARER_TOKEN_PREFIX = "Bearer"; // Bearer직접 넣어서 주는걸로 결정
private final String securityJwtName = "JWT";

@Value("${server.domain}")
private String stagingServerDomain;
@Bean
public OpenAPI openAPI() {

Server localServer = new Server();
localServer.setDescription("FOR BE 로컬 서버");
localServer.setUrl("http://localhost:8080");
Server stagingServer = new Server();
stagingServer.setDescription("이관전 개발서버");
stagingServer.setUrl(stagingServerDomain);
Server productionServer = new Server();
productionServer.setDescription("FOR FE 개발 서버");
productionServer.setUrl("https://genti.kr");
Expand All @@ -37,7 +43,7 @@ public OpenAPI openAPI() {
.bearerFormat(securityJwtName));

return new OpenAPI()
.servers(List.of(localServer, productionServer))
.servers(List.of(localServer, stagingServer, productionServer))
.addSecurityItem(securityRequirement)
.components(components);

Expand Down

0 comments on commit aa2e14c

Please sign in to comment.