diff --git a/src/backend/push-server/build.gradle b/src/backend/push-server/build.gradle index c5b7a674..a0cdf6cf 100644 --- a/src/backend/push-server/build.gradle +++ b/src/backend/push-server/build.gradle @@ -39,11 +39,18 @@ dependencies { // Spring Cloud implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' + implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' // Lombok compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' + // Validation + implementation 'org.hibernate.validator:hibernate-validator:8.0.1.Final' + + // Dotenv + implementation 'io.github.cdimascio:java-dotenv:5.2.2' + // Protobuf implementation 'com.google.protobuf:protobuf-java:3.21.12' diff --git a/src/backend/push-server/src/main/java/com/bbebig/push_server/PushServerApplication.java b/src/backend/push-server/src/main/java/com/bbebig/push_server/PushServerApplication.java index 1472b60d..5c489890 100644 --- a/src/backend/push-server/src/main/java/com/bbebig/push_server/PushServerApplication.java +++ b/src/backend/push-server/src/main/java/com/bbebig/push_server/PushServerApplication.java @@ -1,13 +1,33 @@ package com.bbebig.push_server; +import io.github.cdimascio.dotenv.Dotenv; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; -@SpringBootApplication +@EnableFeignClients +@EnableDiscoveryClient +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) public class PushServerApplication { public static void main(String[] args) { + initEnv(); SpringApplication.run(PushServerApplication.class, args); } + /** + * 스트링부트 실행 전 시스템 property를 설정한다. + */ + static void initEnv() { + Dotenv.configure() + .directory("./src/main/resources/") + .filename(".env") + .load() + .entries() + .forEach(e -> { + System.setProperty(e.getKey(), e.getValue()); + }); + } } diff --git a/src/backend/push-server/src/main/resources/application.yml b/src/backend/push-server/src/main/resources/application.yml index 29f854d1..4bc48425 100644 --- a/src/backend/push-server/src/main/resources/application.yml +++ b/src/backend/push-server/src/main/resources/application.yml @@ -1 +1,24 @@ -spring.application.name=push-server +server: + port: 9060 + +spring: + application: + name: push-server + +eureka: + client: + register-with-eureka: true + fetch-registry: true + service-url: + defaultZone: http://discovery-server:8761/eureka + +eas: + passport: + secretKey: ${PASSPORT_SECRET_KEY} + expiration: ${PASSPORT_EXPIRATION} + header: ${PASSPORT_HEADER} + algorithm: ${PASSPORT_ALGORITHM} + +auth: + server: + url: ${AUTH_SERVER_URL} \ No newline at end of file