Document how server.mjs keeps the site up when an API is misconfigured and reports it on /api/health, the cache and CSP policy, the share API's synchronous reservation, the trust placed in X-Forwarded-For, the hooks main.jsx wires once, and how to run each script. The deploy script header now recalls that CI runs the copy installed on the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
448 B
JavaScript
17 lines
448 B
JavaScript
/**
|
|
* @file Charge le fichier .env facultatif de la racine avec le parseur natif de Node ; une variable déjà définie
|
|
* dans le processus garde sa valeur, même vide.
|
|
*
|
|
* Utilisé par : server.mjs, vite.config.js.
|
|
* @see .env.example
|
|
*/
|
|
|
|
import { loadEnvFile } from "node:process";
|
|
|
|
export function loadProjectEnv(file = ".env") {
|
|
try {
|
|
loadEnvFile(file);
|
|
} catch (error) {
|
|
if (error.code !== "ENOENT") throw error;
|
|
}
|
|
}
|