Skip to content

Commit 875ccb1

Browse files
authored
Merge pull request #78 from prgrms-web-devcourse-final-project/feat/mission
fix : 제미나이 연결 관련 수정
2 parents 00aea44 + 36ea2a5 commit 875ccb1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

backend/src/main/java/com/back/BackApplication.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.back;
22

3+
import com.google.api.client.util.Value;
4+
import jakarta.annotation.PostConstruct;
35
import org.springframework.boot.SpringApplication;
46
import org.springframework.boot.autoconfigure.SpringBootApplication;
57
import org.springframework.cache.annotation.EnableCaching;
@@ -11,7 +13,18 @@
1113
@EnableCaching
1214
@EnableAsync
1315
public class BackApplication {
16+
17+
@Value("${GOOGLE_APPLICATION_CREDENTIALS}")
18+
private String googleCredentialsPath;
19+
1420
public static void main(String[] args) {
1521
SpringApplication.run(BackApplication.class, args);
1622
}
23+
24+
@PostConstruct
25+
public void setGoogleCredentialsEnv() {
26+
// 구글 SDK가 인식할 수 있도록 시스템 속성에 넣어줌
27+
System.setProperty("GOOGLE_APPLICATION_CREDENTIALS", googleCredentialsPath);
28+
}
29+
1730
}

0 commit comments

Comments
 (0)