Add health check endpoint and resolve locale detection bug (#387)

* Add health check API endpoint with database connectivity

* Update locale handling to fallback to default language on invalid input

* Add health check endpoints for application readiness and liveness

- Introduced `/api/health/readiness` endpoint to check if the application can serve requests, including database connectivity.
- Introduced `/api/health/liveness` endpoint to verify if the application is running independently of external dependencies.
- Updated the health check logic to streamline database connectivity checks and response handling.

* Refactor health check logic

---------

Co-authored-by: Julen Dixneuf <julen.d@padoa-group.com>
This commit is contained in:
Julen Dixneuf
2025-09-05 09:53:12 +02:00
committed by GitHub
parent d27cbdba47
commit 409784672c
6 changed files with 118 additions and 1 deletions

View File

@@ -17,7 +17,8 @@ function getAcceptLanguageLocale(requestHeaders: Headers, locales: Locales) {
try {
locale = match(languages, locales, defaultLocale)
} catch (e) {
// invalid language
// invalid language - fallback to default
locale = defaultLocale
}
return locale
}