[object Object]

← back to Dw Signup Fulfillment

5x: add open root status page + favicon 204 (clean base URL, no phantom JS error)

73e3ebf7903209193e6e7b491e0e4653e1ccdcf3 · 2026-07-28 09:42:32 -0700 · Steve

Files touched

Diff

commit 73e3ebf7903209193e6e7b491e0e4653e1ccdcf3
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Jul 28 09:42:32 2026 -0700

    5x: add open root status page + favicon 204 (clean base URL, no phantom JS error)
---
 server.js | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/server.js b/server.js
index 821d61b..2b9c650 100644
--- a/server.js
+++ b/server.js
@@ -22,6 +22,25 @@ const app = express();
 // --- /healthz FIRST, before any auth/body parsing (Steve's fleet rule) ---
 app.get('/healthz', (_req, res) => res.status(200).json({ ok: true, service: 'dw-signup-fulfillment', dry_run: config.DRY_RUN }));
 
+// --- Favicon: 204 so browsers/tools never log a favicon 404. ---
+app.get('/favicon.ico', (_req, res) => res.status(204).end());
+
+// --- Root status page (open) — a clean 200 landing so the base URL is never a bare 404. ---
+app.get('/', (_req, res) => {
+  res.status(200).type('html').send(`<!doctype html><html><head><meta charset="utf-8"><title>DW Signup Fulfillment</title>
+  <style>body{font:15px/1.6 -apple-system,system-ui,sans-serif;margin:40px;color:#1a1a1a;background:#faf9f7}code{background:#eee;padding:1px 5px;border-radius:4px}.p{display:inline-block;padding:2px 8px;border-radius:4px;background:${config.DRY_RUN ? '#fde68a' : '#bbf7d0'};font-size:12px}</style>
+  </head><body>
+  <h1>DW Signup Fulfillment <span class="p">DRY_RUN: ${config.DRY_RUN ? 'ON' : 'OFF (LIVE)'}</span></h1>
+  <p>Service is running. It emails new customers a 3-free-samples gift code and handles trade applications.</p>
+  <ul>
+    <li><code>GET /healthz</code> — liveness (open)</li>
+    <li><code>POST /webhooks/customers/create</code> — Shopify webhook (HMAC-verified)</li>
+    <li><code>POST /trade/apply</code> — trade application intake</li>
+    <li><code>GET /admin/trade</code> — trade review (basic-auth)</li>
+  </ul>
+  </body></html>`);
+});
+
 // --- Webhook receiver needs the RAW body for HMAC. Mount raw parser on that path
 //     ONLY, before the global JSON parser. ---
 app.post('/webhooks/customers/create',

← a8ed621 retail: wire automatic gift-card (unique code emailed per si  ·  back to Dw Signup Fulfillment  ·  5x: REPORT.md — two consecutive clean sweeps; admin Approve 38fc598 →