Mise à jour de index.js
This commit is contained in:
parent
a19dbfdd4b
commit
622053c08e
15
index.js
15
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 ---
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user