From c78f246d96af7ce153e13341029470cefe1d35fc Mon Sep 17 00:00:00 2001 From: sBubshait Date: Sun, 20 Jul 2025 15:14:09 +0300 Subject: [PATCH] feat: conncet backend with database --- backend/.gitignore | 2 ++ .../src/main/resources/application.properties | 1 + backend/src/main/resources/application.yml | 21 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 backend/src/main/resources/application.yml diff --git a/backend/.gitignore b/backend/.gitignore index 667aaef..239f1c2 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -31,3 +31,5 @@ build/ ### VS Code ### .vscode/ +.env +env.properties \ No newline at end of file diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index d336da1..7e8b481 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1 +1,2 @@ spring.application.name=wesal +spring.config.import=env.properties \ No newline at end of file diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml new file mode 100644 index 0000000..541a4fe --- /dev/null +++ b/backend/src/main/resources/application.yml @@ -0,0 +1,21 @@ +spring: + datasource: + url: ${DB_URL} + username: ${DB_USER} + password: ${DB_PASSWORD} + driver-class-name: org.postgresql.Driver + + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + format_sql: true + + application: + name: wesal + +server: + port: 8080