Skip to content

Commit

Permalink
Merge pull request #263 from vianneynara/feature/262-refactor-propert…
Browse files Browse the repository at this point in the history
…ies-with-yaml

Refactor properties with YAML format
  • Loading branch information
vianneynara authored Dec 13, 2024
2 parents 0768415 + 6ac7ee1 commit dfe9e02
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/**
* This is not an explicit configuration class, but a necessary component to read
* the application properties of 'application' in `application.properties` and helps
* the application properties of 'application' in `application.yaml` and helps
* to initialize the properties through dotenv.
*/
@Component
Expand Down
14 changes: 0 additions & 14 deletions src/main/resources/application-postgres.properties

This file was deleted.

15 changes: 15 additions & 0 deletions src/main/resources/application-postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spring:
datasource:
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: org.postgresql.Driver
jpa:
properties:
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate:
ddl-auto: update
show-sql: false
h2:
console:
enabled: false
63 changes: 0 additions & 63 deletions src/main/resources/application.properties

This file was deleted.

78 changes: 78 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
spring:
application:
name: KuenyaWZ API
cache:
type: caffeine
cache-names: productsCache,productDto,purchasesCache
# Uncomment to override the default cache configuration
# caffeine:
# spec: maximumSize=300,expireAfterAccess=3m
datasource:
hikari:
pool-name: KuenyaWZ-Pool
maximum-pool-size: 5
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
useLocalSessionState: true
rewriteBatchedStatements: true
cacheResultSetMetadata: true
cacheServerConfiguration: true
elideSetAutoCommits: true
maintainTimeStats: false
h2:
console:
enabled: true
jpa:
show-sql: false
properties:
hibernate.format_sql: true
servlet:
multipart:
max-file-size: 10MB
max-request-size: 15MB

springdoc:
swagger-ui:
path: /swagger-ui
operations-sorter: alpha
api-docs:
path: /docs/v3

application:
version: 1.0
repositoryUrl: https://github.com/vianneynara/kuenyawz-api
accepted-image-extensions: png,jpg,jpeg,webp
max-variant-quantity: 250
otp-format: numeric
seeder:
seed-accounts: true
seed-products: true

server:
port: 8081

management:
endpoint:
health:
probes:
enabled: true
show-details: when_authorized
shutdown:
enabled: true
health:
readinessstate:
enabled: true
livenessstate:
enabled: true
endpoints:
web:
exposure:
include: health,info,shutdown

logging:
level:
dev.kons.kuenyawz.filters.RequestLoggingFilter: DEBUG
org.springframework.security: debug

0 comments on commit dfe9e02

Please sign in to comment.