-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/goormthonUniv/floating/FloatingApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
package goormthonUniv.floating; | ||
|
||
import io.github.cdimascio.dotenv.Dotenv; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class FloatingApplication { | ||
|
||
public static void main(String[] args) { | ||
// .env 파일 로드 | ||
Dotenv dotenv = Dotenv.load(); | ||
|
||
// 환경 변수 읽기 | ||
String dbUrl = dotenv.get("DB_URL"); | ||
String dbUsername = dotenv.get("DB_USERNAME"); | ||
String dbPassword = dotenv.get("DB_PASSWORD"); | ||
String oauthClientId = dotenv.get("OAUTH_CLIENT_ID"); | ||
String oauthClientSecret = dotenv.get("OAUTH_CLIENT_SECRET"); | ||
|
||
// 환경 변수를 시스템에 설정 (필요한 경우) | ||
System.setProperty("DB_URL", dbUrl); | ||
System.setProperty("DB_USERNAME", dbUsername); | ||
System.setProperty("DB_PASSWORD", dbPassword); | ||
System.setProperty("OAUTH_CLIENT_ID", oauthClientId); | ||
System.setProperty("OAUTH_CLIENT_SECRET", oauthClientSecret); | ||
|
||
SpringApplication.run(FloatingApplication.class, args); | ||
|
||
} | ||
|
||
} |