feat(01-02): add /ready endpoint with database connectivity check

- Add GET /ready endpoint that checks database connection
- Returns 200 'ready' when connected, 503 when not
- Update Routes to require DataSource dependency
- Provide dataSourceLayer in Main.scala
- Use 'hikari' prefix for HikariCP config to avoid ZIO config conflict
This commit is contained in:
Jakub Zych
2026-02-04 22:20:35 +01:00
parent ddb1964d1a
commit 0059add4a1
5 changed files with 33 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ server {
port = ${?SERVER_PORT}
}
# Database configuration for ZIO config (used by AppConfig)
# Database configuration for ZIO config (used by AppConfig.DatabaseConfig)
database {
host = "localhost"
host = ${?DB_HOST}
@@ -20,8 +20,8 @@ database {
}
# HikariCP configuration for Quill DataSource
# Reads from "database" prefix via Quill.DataSource.fromPrefix
database {
# Uses separate prefix to avoid conflict with ZIO config "database" property
hikari {
dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource"
dataSource {
serverName = "localhost"