Mise à jour de index.js
This commit is contained in:
parent
83f7ad0553
commit
39f7256c0b
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
|
|
@ -170,7 +170,7 @@ pipeline {
|
||||||
|
|
||||||
def statusCode = "000"
|
def statusCode = "000"
|
||||||
for (int i = 1; i <= 10; i++) {
|
for (int i = 1; i <= 10; i++) {
|
||||||
statusCode = sh(script: "curl -k -s -o /dev/null -w '%{http_code}' https://${domain}/health || echo 000", returnStdout: true).trim()
|
statusCode = sh(script: "curl -k -s -o /dev/null -w '%{http_code}' https://${domain}/ || echo 000", returnStdout: true).trim()
|
||||||
if (statusCode in ['200', '301', '302']) {
|
if (statusCode in ['200', '301', '302']) {
|
||||||
echo "✅ Backend ${env.ENV} opérationnel (HTTP ${statusCode})"
|
echo "✅ Backend ${env.ENV} opérationnel (HTTP ${statusCode})"
|
||||||
return
|
return
|
||||||
|
|
|
||||||
4
index.js
4
index.js
|
|
@ -21,9 +21,7 @@ app.use(helmet());
|
||||||
app.use(morgan("tiny"));
|
app.use(morgan("tiny"));
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
app.get("/health", (req, res) => {
|
|
||||||
res.status(200).send("OK");
|
|
||||||
});
|
|
||||||
// --- Vérification connexion DB ---
|
// --- Vérification connexion DB ---
|
||||||
app.get("/db-check", async (req, res) => {
|
app.get("/db-check", async (req, res) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user