Add ability to upload files to external webhooks

Import and utilize the 'form-data' library in server/routes.ts to construct and send multipart/form-data payloads to external webhooks.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 181f13b7-a0a2-4b4f-989d-214861ea2c19
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/LXHtbOp
This commit is contained in:
michaelschal committed 2025-11-04 14:54:28 +00:00
1 parent cbcef39aa2
commit e9827c333d
3 files changed
+1 -1

No files matched your search

+1 -1
View File
@@ -128,6 +128,7 @@ import { invoiceVerificationService } from "./invoiceVerification";
import { backupService } from "./backupService";
import { weatherService } from "./weatherService.js";
import fetch from "node-fetch";
import FormData from "form-data";
export async function registerRoutes(app: Express): Promise<Server> {
// Detect environment
@@ -820,7 +821,6 @@ export async function registerRoutes(app: Express): Promise<Server> {
});
// Préparer le FormData pour l'envoi au webhook externe
const FormData = (await import('form-data')).default;
const formData = new FormData();
// Ajouter tous les champs du formData