From 622053c08e14c466c8f7f5f0f52a893831e11860 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 3 Nov 2025 22:19:36 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20index.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index b7d95247..022304be 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,6 @@ import { pool } from "./db.js"; dotenv.config(); const app = express(); -// --- Middlewares globaux --- app.use( cors({ origin: ["http://localhost:3000", "https://dsp5-archi-o24a-15m-g3.fr"], @@ -20,11 +19,6 @@ app.use(helmet()); app.use(morgan("tiny")); app.use(express.json()); -// --- Endpoint de santé pour CI/CD et monitoring --- -app.get("/health", (req, res) => { - res.status(200).json({ status: "ok" }); -}); - // --- Vérification connexion DB --- app.get("/db-check", async (req, res) => { try { @@ -35,9 +29,14 @@ app.get("/db-check", async (req, res) => { } }); -// --- Route d’accueil (fix pour 'Cannot GET /') --- +// --- Route santé --- +app.get("/health", (req, res) => { + res.status(200).json({ status: "ok" }); +}); + +// --- Route d’accueil --- app.get("/", (req, res) => { - res.json({ message: "✅ API Thé Tip Top en ligne et opérationnelle vk1001001 !" }); + res.json({ message: "✅ API Thé Tip Top en ligne et opérationnelle g1001001 !" }); }); // --- Monitoring Prometheus ---