Update BAP webhook configuration URL and improve error handling

Correct the webhook URL for BAP configuration in multiple files (client, server, migrations). Adjust server startup logic to prevent crashes due to database migration failures in production, and add more verbose logging for environment and database connection status. Reorder integrations in `.replit` file.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cfbfe47c-0c9a-4ebf-8a41-2937407eccff
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cfbfe47c-0c9a-4ebf-8a41-2937407eccff/qkkp1hi
This commit is contained in:
michaelschal committed 2025-09-03 13:53:38 +00:00
1 parent bce62c78a9
commit c55ec19939
7 files changed
+131 -10

No files matched your search

+7 -5
View File
@@ -2,18 +2,20 @@ import express, { type Request, Response, NextFunction } from "express";
import { registerRoutes } from "./routes.js";
import { setupVite, serveStatic } from "./vite.js";
// Run database migrations first
// Run database migrations first - FORCER EN PRODUCTION
console.log('🔄 [STARTUP] Running database migrations...');
console.log('🔍 [STARTUP] Environment:', process.env.NODE_ENV);
console.log('🔍 [STARTUP] Has DATABASE_URL:', !!process.env.DATABASE_URL);
try {
const { runMigrations } = await import('./migrations.js');
await runMigrations();
console.log('✅ [STARTUP] Database migrations completed');
} catch (error) {
console.error('❌ [STARTUP] Database migrations failed:', error);
// Ne pas arrêter l'app en développement
if (process.env.NODE_ENV === 'production') {
process.exit(1);
}
console.error('❌ [STARTUP] Error details:', JSON.stringify(error, null, 2));
// NE PAS arrêter l'app pour éviter les boucles de redémarrage
console.warn('⚠️ [STARTUP] Continuing without migrations to avoid restart loop');
}
// Initialize weather system
+1 -1
View File
@@ -51,7 +51,7 @@ export async function runMigrations() {
INSERT INTO webhook_bap_config (name, webhook_url, description, is_active)
SELECT
'Configuration BAP',
'https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d',
'https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d',
'Configuration par défaut pour envoi des fichiers BAP vers n8n',
true
WHERE NOT EXISTS (SELECT 1 FROM webhook_bap_config);`
+1 -1
View File
@@ -95,7 +95,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
return res.json({
id: 1,
name: "Configuration BAP",
webhookUrl: "https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
webhookUrl: "https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
description: "Configuration par défaut (table non créée)",
isActive: true,
needsTableCreation: true
+1 -1
View File
@@ -3896,7 +3896,7 @@ export class MemStorage implements IStorage {
return {
id: 1,
name: "Configuration BAP",
webhookUrl: "https://workflow.ffnancy.fr/webhook-test/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
webhookUrl: "https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
description: "Configuration par défaut pour développement",
isActive: true,
createdAt: new Date(),