Skip to content

Add health check endpoint and resolve locale detection bug#387

Merged
Petersmit27 merged 5 commits intospliit-app:mainfrom
dixneuf19:feat/healthcheck
Sep 5, 2025
Merged

Add health check endpoint and resolve locale detection bug#387
Petersmit27 merged 5 commits intospliit-app:mainfrom
dixneuf19:feat/healthcheck

Conversation

@dixneuf19
Copy link
Copy Markdown
Contributor

Hi,

After being impacted by #221 I wanted to contribute to this great replacement for Tricount.
I let loose Cursor to get this very basic implementation for:

  • A health check endpoint, useful in environments such as Kubernetes

I differentiated "liveness" and "readiness" probe but for most cases just the /api/health will be enough.

  • Fix the locale selection with a sane default in case of error --> default to en-US

New Endpoints

GET /api/health           # Default (same as readiness) - for monitoring tools
GET /api/health/liveness  # App health only - for Kubernetes liveness probe
GET /api/health/readiness # All dependencies - for Kubernetes readiness probe

The response looks like this (code 200 or 503). We could add test to other external services such as S3/openAI but I think it would be overkill for the moment

{
  "status": "healthy",
  "services": {
    "database": {
      "status": "healthy"
    }
  }
}

Local Testing

  • curl http://localhost:3000 - No more 500 errors with missing Accept-Language
  • All health endpoints work correctly with/without database

Let me know if you want to spliit this into two PR, but it should close #221.

Julen Dixneuf and others added 5 commits July 27, 2025 18:31
- 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.
@Petersmit27 Petersmit27 merged commit 4097846 into spliit-app:main Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uptime-kuma: Spliit return Internal Server Error 500

2 participants