Skip to content

Commit

Permalink
feat: (#347) 설정 환경변수 설정 (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
woo-chang authored Aug 13, 2023
1 parent a925528 commit 78ad7ca
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 28 deletions.
13 changes: 2 additions & 11 deletions backend/src/main/java/com/votogether/config/OpenAPIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@
public class OpenAPIConfig {

private final String devUrl;
private final String prodUrl;

public OpenAPIConfig(
@Value("${votogether.openapi.dev-url}") final String devUrl,
@Value("${votogether.openapi.prod-url}") final String prodUrl
) {
public OpenAPIConfig(@Value("${votogether.openapi.dev-url}") final String devUrl) {
this.devUrl = devUrl;
this.prodUrl = prodUrl;
}

@Bean
Expand All @@ -33,10 +28,6 @@ public OpenAPI openAPI() {
devServer.setUrl(devUrl);
devServer.description("개발 환경 서버 URL");

final Server prodServer = new Server();
prodServer.setUrl(prodUrl);
prodServer.description("운영 환경 서버 URL");

final Info info = new Info()
.title("VoTogether API")
.version("v1.0.0")
Expand All @@ -55,7 +46,7 @@ public OpenAPI openAPI() {

return new OpenAPI()
.info(info)
.servers(List.of(devServer, prodServer))
.servers(List.of(devServer))
.components(new Components().addSecuritySchemes("bearerAuth", securityScheme))
.security(List.of(securityRequirement));
}
Expand Down
27 changes: 11 additions & 16 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
spring:
datasource:
url: jdbc:h2:mem:test;MODE=MySQL
username: sa
driver-class-name: ${DATASOURCE_DRIVER_CLASS_NAME}
url: ${DATASOURCE_URL}
username: ${DATASOURCE_USERNAME}
password: ${DATASOURCE_PASSWORD}

jpa:
database-platform: org.hibernate.dialect.MySQLDialect
show-sql: true

properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQLDialect
default_batch_fetch_size: 50
show-sql: true

hibernate:
ddl-auto: create
ddl-auto: ${HIBERNATE_DDL_AUTO}

servlet:
multipart:
Expand All @@ -21,19 +24,12 @@ spring:

h2:
console:
enabled: true
enabled: ${H2_CONSOLE_ENABLE}
path: /h2-console
settings:
web-allow-others: true

logging:
level:
org:
hibernate:
type:
descriptor:
sql:
BasicBinder: TRACE
org.hibernate.orm.jdbc.bind: trace

server:
forward-headers-strategy: FRAMEWORK
Expand All @@ -44,8 +40,7 @@ springdoc:

votogether:
openapi:
dev-url: http://localhost:8080
prod-url: ${PROD_URL}
dev-url: ${DEV_URL}

oauth:
kakao:
Expand Down
29 changes: 28 additions & 1 deletion backend/src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
spring:
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:test;MODE=MySQL
username: sa
password:

jpa:
database-platform: org.hibernate.dialect.MySQLDialect
show-sql: true

properties:
hibernate:
format_sql: true
default_batch_fetch_size: 50

hibernate:
ddl-auto: create

servlet:
multipart:
max-file-size: 30MB
max-request-size: 30MB

h2:
console:
enabled: false
path: /h2-console

logging:
level:
org.hibernate.orm.jdbc.bind: trace

server:
forward-headers-strategy: FRAMEWORK

springdoc:
swagger-ui:
enabled: false

votogether:
openapi:
dev-url: http://localhost:8080
prod-url: http://aaaaaaaa.com

oauth:
kakao:
Expand Down

0 comments on commit 78ad7ca

Please sign in to comment.