SPB Git forge

spb/api-ka

Public

API-KA — plateforme centrale : collecte quotidienne des 8 services KA, historisation append-only et API publique sur www.api-ka.com

48commits 1branches 0releases
5.9 MBsize
maindefault branch
19 days agolast push
Python 60.9% HTML 21% TypeScript 7.3% JavaScript 5.2% CSS 4.8% Shell 0.8%
758 B · 29 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# ============================================3# Projet   : API-KA4# Fichier  : scripts/healthcheck.sh5# Node     : m3u96b6# Author   : Simon-Pierre Boucher7# Contact  : contact@spboucher.ai8# Date     : 2026-08-169# ============================================10# Vérification de santé utilisée par systemd / monitoring.11# Exit 0 si l'API répond et que la base est OK, exit 1 sinon.1213set -uo pipefail1415URL="http://127.0.0.1:${API_PORT:-8000}/health"1617RESPONSE="$(curl -fsS --max-time 10 "$URL" 2>/dev/null)" || {18    echo "❌ API-KA injoignable sur $URL"19    exit 120}2122if echo "$RESPONSE" | grep -q '"database": *"ok"'; then23    echo "✅ API-KA en bonne santé ($URL)"24    exit 025fi2627echo "❌ API-KA dégradée : $RESPONSE"28exit 129