sokko-g/scripts/load-project-env.mjs
Shinuwa d8c94f6834 Give the server, React entry, shared hooks and scripts headers that explain their role and pitfalls
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>
2026-12-01 11:00:04 +01:00

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;
}
}