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
3 changes: 3 additions & 0 deletions backend/pirocheck/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ out/

### VS Code ###
.vscode/

### 환경 변수 ###
.env
15 changes: 15 additions & 0 deletions backend/pirocheck/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// REST API 사용을 위해 반드시 필요
implementation 'org.springframework.boot:spring-boot-starter-web'

// DTO에서 @Valid 사용 시 필요
implementation 'org.springframework.boot:spring-boot-starter-validation'

// PostgreSQL
runtimeOnly 'org.postgresql:postgresql'

// 환경변수 관리
implementation 'io.github.cdimascio:java-dotenv:5.2.2'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import io.github.cdimascio.dotenv.Dotenv;

@SpringBootApplication
public class PirocheckApplication {

public static void main(String[] args) {

// .env 파일 로드
Dotenv dotenv = Dotenv.configure()
.directory("./") // .env 파일 경로 설정 (기본: 프로젝트 루트)
.load();

// 환경변수를 시스템 프로퍼티에 추가
dotenv.entries().forEach(entry ->
System.setProperty(entry.getKey(), entry.getValue())
);

SpringApplication.run(PirocheckApplication.class, args);
}

Expand Down

This file was deleted.

12 changes: 12 additions & 0 deletions backend/pirocheck/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
spring:
datasource:
url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
username: ${DB_USER}
password: ${DB_PASSWORD}
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true