Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .env.default
Empty file.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
testImplementation("org.springframework.boot:spring-boot-starter-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.13")
implementation ("io.github.cdimascio:dotenv-java:3.0.0")
}

tasks.withType<Test> {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/back/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

}
}
4 changes: 2 additions & 2 deletions src/main/java/com/back/global/config/SpringDocConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class SpringDocConfig {
@Bean
public GroupedOpenApi groupApiV1() {
return GroupedOpenApi.builder()
.group("apiV1")
.pathsToMatch("/api/v1/**")
.group("api")
.pathsToMatch("/api/**")
.build();
}
}
27 changes: 27 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
spring:
datasource:
url: jdbc:h2:./db_dev;MODE=MySQL
driver-class-name: org.h2.Driver
username: sa
password:

config:
import: optional:file:.env[.properties]

jpa:
database-platform: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update # [none | validate | update | create | create-drop]
show-sql: true
properties:
hibernate:
format_sql: true
highlight_sql: true
use_sql_comments: true

springdoc:
default-produces-media-type: application/json;charset=UTF-8

logging:
level:
org.hibernate.orm.jdbc.bind: trace
17 changes: 17 additions & 0 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
spring:
jpa:
database-platform: org.hibernate.dialect.MySQLDialect
hibernate:
ddl-auto: validate # [none | validate | update | create | create-drop]

config:
import: optional:file:.env[.properties]

datasource:
url: jdbc:mysql://${MYSQL_HOST}:3306/${MYSQL_DATABASE}?serverTimezone=Asia/Seoul&characterEncoding=UTF-8
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}

springdoc:
default-produces-media-type: application/json;charset=UTF-8
28 changes: 2 additions & 26 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,5 @@ spring:
application:
name: catfe-backend

datasource:
url: jdbc:h2:./db_dev;MODE=MySQL
driver-class-name: org.h2.Driver
username: sa
password:

config:
import: optional:file:.env

jpa:
database-platform: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update # [none | validate | update | create | create-drop]
show-sql: true
properties:
hibernate:
format_sql: true
highlight_sql: true
use_sql_comments: true

springdoc:
default-produces-media-type: application/json;charset=UTF-8

logging:
level:
org.hibernate.orm.jdbc.bind: trace
profiles:
active: dev