flatten backend folder
This commit is contained in:
parent
bf50fa2246
commit
bffd84bd17
12
index.js
12
index.js
|
|
@ -19,14 +19,14 @@ app.use(helmet());
|
||||||
app.use(morgan("tiny"));
|
app.use(morgan("tiny"));
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
// ✅ Nouvelle route /health pour Jenkins
|
|
||||||
app.get("/health", (req, res) => {
|
app.get("/health", (req, res) => {
|
||||||
res.status(200).json({ status: "ok" });
|
res.status(200).json({ status: "ok" });
|
||||||
|
});
|
||||||
|
|
||||||
|
// ✅ Route racine (pour test ou monitoring)
|
||||||
|
app.get("/", (req, res) => {
|
||||||
|
res.status(200).json({ message: "✅ API The Tip Top en ligne et opérationnelle !" });
|
||||||
});
|
});
|
||||||
|
|
||||||
// ✅ Route racine (pour éviter le 404 sur /)
|
|
||||||
|
|
||||||
|
|
||||||
// Vérif base de données
|
// Vérif base de données
|
||||||
app.get("/db-check", async (req, res) => {
|
app.get("/db-check", async (req, res) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -49,4 +49,4 @@ app.get("/metrics", async (req, res) => {
|
||||||
const PORT = process.env.PORT || 4000;
|
const PORT = process.env.PORT || 4000;
|
||||||
app.listen(PORT, "0.0.0.0", () => {
|
app.listen(PORT, "0.0.0.0", () => {
|
||||||
console.log(`🚀 Backend lancé sur 0.0.0.0:${PORT} ✅`);
|
console.log(`🚀 Backend lancé sur 0.0.0.0:${PORT} ✅`);
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue
Block a user