← back to Commercialrealestate
serve.js: load project .env via native process.loadEnvFile (enables GEORGE_AUTH/GMAIL_BASIC_AUTH_B64 + fixes CENSUS_API_KEY loading)
5a19595431526e5dff757ad0a1ae6798694387ad · 2026-07-17 08:55:00 -0700 · Steve
Files touched
Diff
commit 5a19595431526e5dff757ad0a1ae6798694387ad
Author: Steve <steve@designerwallcoverings.com>
Date: Fri Jul 17 08:55:00 2026 -0700
serve.js: load project .env via native process.loadEnvFile (enables GEORGE_AUTH/GMAIL_BASIC_AUTH_B64 + fixes CENSUS_API_KEY loading)
---
scripts/serve.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/serve.js b/scripts/serve.js
index 2863712..2a3a115 100644
--- a/scripts/serve.js
+++ b/scripts/serve.js
@@ -9,6 +9,10 @@ const { lookupAddress } = require('./sources/wholivedthere'); // READ-ONLY WhoLi
let brokerdb = null; try { brokerdb = require('./db/brokers-db'); } catch (_) {} // broker graph (cre DB)
const ROOT = path.join(__dirname, '..');
+// Load the project .env into process.env (Node 20.12+/22+ native, no dotenv dep). Lets prod carry
+// GMAIL_BASIC_AUTH_B64/GEORGE_AUTH (for the Send-via-George Gmail draft) + CENSUS_API_KEY without
+// baking secrets into pm2. Best-effort: a missing .env just leaves process.env as-is.
+try { if (typeof process.loadEnvFile === 'function') process.loadEnvFile(path.join(ROOT, '.env')); } catch (_) {}
// Assessor roll fallback for DB-less prod (Kamatera has no Postgres). The 2.43M-parcel roll is too
// large for a JSON snapshot, so it ships as a read-only SQLite file (data/assessor.sqlite, built by
← c164c3f Add gated Send-via-George button — creates a Gmail DRAFT (ne
·
back to Commercialrealestate
·
Harden agent-contact CRM (contrarian gate): serialize writes ed5770b →