Repository Public
1// Pile jetable du studio de modèles : port 8791, base sp_mail_tpldev — indépendante de la suite du webmail (8751, sp_mail_webdev).2import fs from "node:fs"34// Surcharges (plusieurs arbres de travail sur le même poste) : SPMAIL_E2E_STUDIO_PORT, SPMAIL_E2E_STUDIO_DB (nom de base se terminant5// par « dev »), SPMAIL_E2E_STUDIO_OUT.6export const PORT = Number(process.env.SPMAIL_E2E_STUDIO_PORT) || 87917export const ORIGIN = `http://localhost:${PORT}`8export const DB_NAME = process.env.SPMAIL_E2E_STUDIO_DB || "sp_mail_tpldev"9export const DB = `postgres://127.0.0.1/${DB_NAME}`10export const OUT = process.env.SPMAIL_E2E_STUDIO_OUT || "/tmp/spmail-e2e-studio"11export const STORAGE = `${OUT}/storage.json`12export const FIXTURES = new URL("../fixtures/", import.meta.url).pathname1314/** En-têtes exigés par l'API pour une requête non GET émise hors de la page (Origin + anti-CSRF). */15export const API_HEADERS = { origin: ORIGIN, "x-spmail": "1" }16export const hasStorage = () => fs.existsSync(STORAGE)17