-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
e81bea7
commit 3426fc7
Showing
7 changed files
with
91 additions
and
23 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DB_URL=jdbc:postgresql://localhost:5432/todo_db | ||
DB_USERNAME=todo_dev | ||
DB_PASSWORD=todo-123 | ||
DB_NAME=todo_db | ||
[email protected] | ||
PGADMIN_PASSWORD=todo123 |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/pedro/rest/configuration/Properties.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.pedro.rest.configuration; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class Properties { | ||
|
||
@Value("${DB_URL}") | ||
private String dbUrl; | ||
|
||
@Value("${DB_USERNAME}") | ||
private String dbUsername; | ||
|
||
@Value("${DB_PASSWORD}") | ||
private String dbPassword; | ||
|
||
@Value("${DB_NAME}") | ||
private String dbName; | ||
|
||
@Value("${PGADMIN_MAIL}") | ||
private String pgAdminMail; | ||
|
||
@Value("${PGADMIN_PASSWORD}") | ||
private String pgAdminPassord; | ||
|
||
@PostConstruct | ||
public void printProperties() { | ||
System.out.println("#### [App Properties] ####"); | ||
System.out.println("DB_URL: " + dbUrl); | ||
System.out.println("DB_USERNAME: " + dbUsername); | ||
System.out.println("DB_PASSWORD: " + dbPassword); | ||
System.out.println("DB_NAME: " + dbName); | ||
System.out.println("PGADMIN_MAIL: " + pgAdminMail); | ||
System.out.println("PGADMIN_PASSWORD: " + pgAdminPassord); | ||
} | ||
} |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
spring.datasource.url=jdbc:h2:mem:rest_db | ||
spring.datasource.username=sa | ||
spring.datasource.password= | ||
spring.h2.console.enabled=true |