Skip to content

Commit

Permalink
Chore: 배포와 로컬 환경 스웨거 서버 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnida committed Jan 24, 2025
1 parent 7dca42b commit d024799
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/com/cmc/mercury/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.info.Info;
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;

import java.util.List;

@Configuration
public class SwaggerConfig {

@Value("${SWAGGER_HTTPS_URL}")
private String httpsUrl;

@Value("${SWAGGER_HTTP_URL}")
private String httpUrl;

@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.servers(List.of(
new Server().url(httpsUrl).description("배포(HTTPS)"),
new Server().url(httpUrl).description("로컬(HTTP)")
))
.components(new Components())
.info(apiInfo());
}
Expand Down

0 comments on commit d024799

Please sign in to comment.