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 ---