← back to Re Flyer Aggregator
serve-viewers: honor PORT env (default 9862) for Kamatera deploy
ca7ef7d814df34312156bb292680a3c284b1398d · 2026-08-20 08:57:08 -0700 · Steve Abrams
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
Diff
commit ca7ef7d814df34312156bb292680a3c284b1398d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Aug 20 08:57:08 2026 -0700
serve-viewers: honor PORT env (default 9862) for Kamatera deploy
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
serve-viewers.mjs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/serve-viewers.mjs b/serve-viewers.mjs
index 5593e80..1799a88 100644
--- a/serve-viewers.mjs
+++ b/serve-viewers.mjs
@@ -2,6 +2,7 @@ import http from 'node:http'; import { readFileSync, statSync } from 'node:fs';
const PUB = join(dirname(fileURLToPath(import.meta.url)), 'public');
const MIME = {'.html':'text/html','.json':'application/json','.csv':'text/csv','.js':'text/javascript','.css':'text/css','.png':'image/png'};
const ROOT = dirname(fileURLToPath(import.meta.url));
+const PORT = process.env.PORT || 9862;
const ALIAS = { '/':'/sources/index.html', '/sources':'/sources/index.html', '/live.html':'/flyers/live.html',
'/flyers.json':'/flyers/flyers.json', '/advertising':'/advertising/index.html', '/property-flyers':'/flyers-found/index.html', '/flyers-found':'/flyers-found/index.html', '/flyers':'/flyers/index.html',
'/search':'/search/index.html', '/deals':'/deals/index.html', '/properties':'/properties/index.html', '/listings':'/search/index.html' };
@@ -12,4 +13,4 @@ http.createServer((q,s)=>{
try { if (statSync(fp).isDirectory()) fp = join(fp,'index.html'); } catch {}
try { const b = readFileSync(fp); s.writeHead(200,{'content-type':MIME[extname(fp)]||'text/html','cache-control':'no-store','access-control-allow-origin':'*'}); s.end(b); }
catch(e){ s.writeHead(404); s.end('not found: '+u); }
-}).listen(9862, ()=>console.log('viewers :9862 — / = sources dashboard, /live.html = viz, /advertising = ad intel'));
+}).listen(PORT, ()=>console.log(`viewers :${PORT} — / = sources dashboard, /live.html = viz, /advertising = ad intel`));
← 9ea2e7d add PER-PROPERTY index (Steve: data on every property) — bui
·
back to Re Flyer Aggregator
·
auto-data-snapshot: 2026-08-20T09:06:02 (1 data files) — pub 389c082 →