Skip to content

Commit

Permalink
chore: SwaggerConfig 서버 리스트 추가 (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
sejineer authored Jan 21, 2024
1 parent 8a9b140 commit 1b70ce9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/com/shallwe/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.shallwe.global.config;

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;
Expand All @@ -12,13 +13,18 @@
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;

import java.util.List;

@Configuration
public class SwaggerConfig {

private final String securitySchemeName = "bearerAuth";

@Bean
public OpenAPI openAPI(@Value("OpenAPI") String appVersion) {
Server prodServer = new Server().url("https://api.shallwes.com").description("운영 서버");
Server devServer = new Server().url("https://api.shallwes.com/dev").description("개발 서버");
Server localServer = new Server().url("http://localhost:8080").description("로컬 서버");
Info info = new Info().title("Shall We API").version(appVersion)
.description("Shall We API입니다.")
.termsOfService("https://shallews.com")
Expand All @@ -38,7 +44,8 @@ public OpenAPI openAPI(@Value("OpenAPI") String appVersion) {
.bearerFormat("JWT")
)
)
.info(info);
.info(info)
.servers(List.of(prodServer, devServer, localServer));
}

}

0 comments on commit 1b70ce9

Please sign in to comment.