From 8fb585246c17acc9f90092b747bf5d78c6d3e1e9 Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 28 Aug 2026 07:26:57 -0500 Subject: [PATCH] =?UTF-8?q?Route=20/p/=20into=20the=20API=20handler=20?= =?UTF-8?q?=E2=80=94=20member=20pages=20are=20dynamic=20HTML=20and=20were?= =?UTF-8?q?=20falling=20through=20to=20the=20static=20404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 2bc21eb..d380db4 100644 --- a/server.js +++ b/server.js @@ -1009,7 +1009,9 @@ function serveMemberPage(req,res,file,kind,id){ const server=http.createServer(async(req,res)=>{ try{ const u=new URL(req.url,`http://${req.headers.host||'localhost'}`),pathname=decodeURIComponent(u.pathname); - if(pathname==='/health'||pathname.startsWith('/api/'))return await handleApi(req,res,pathname); + // /p/ = member Page Builder pages: dynamic HTML, so it must reach the + // API handler rather than the static-file path (which 404s it). + if(pathname==='/health'||pathname.startsWith('/api/')||/^\/p\/\d{1,15}$/.test(pathname))return await handleApi(req,res,pathname); if(req.method!=='GET'&&req.method!=='HEAD')return send(res,405,'Method Not Allowed',{'Content-Type':'text/plain; charset=utf-8'}); // Members-area gate: the Circle Method lessons 2-10 + the e-gift cash-out // walkthrough are the PRODUCT — their video FILES require a wallet-verified