feat: route /api/ping + message d'erreur affiche l'URL cible

- Ajout route GET /api/ping pour diagnostic connectivité rapide
- Le message 'serveur injoignable' affiche maintenant l'URL exacte tentée
- Aide à identifier les problèmes de proxy/iframe (mauvaise origine)
This commit is contained in:
2026-06-25 15:28:30 -04:00
parent 41fcb238b1
commit 4917dad351
4 changed files with 15 additions and 9 deletions
+6
View File
@@ -100,6 +100,7 @@ pub fn api_routes(state: AppState) -> Router {
let state = Arc::new(state);
Router::new()
.route("/api/health", get(health_check))
.route("/api/ping", get(ping))
.route("/api/auth/validate", post(validate_api_key))
.route("/api/upload", post(upload_image))
.route("/api/images", get(list_images))
@@ -119,6 +120,11 @@ async fn health_check() -> &'static str {
"OK"
}
/// Test de connectivité minimal
async fn ping() -> Json<serde_json::Value> {
Json(serde_json::json!({"pong": true, "timestamp": chrono::Utc::now().to_rfc3339()}))
}
/// Retourne la version de l'application et des infos utiles
async fn version() -> Json<serde_json::Value> {
Json(serde_json::json!({