Route /p/<id> into the API handler — member pages are dynamic HTML and were falling through to the static 404
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1009,7 +1009,9 @@ function serveMemberPage(req,res,file,kind,id){
|
|||||||
const server=http.createServer(async(req,res)=>{
|
const server=http.createServer(async(req,res)=>{
|
||||||
try{
|
try{
|
||||||
const u=new URL(req.url,`http://${req.headers.host||'localhost'}`),pathname=decodeURIComponent(u.pathname);
|
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/<id> = 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'});
|
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
|
// 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
|
// walkthrough are the PRODUCT — their video FILES require a wallet-verified
|
||||||
|
|||||||
Reference in New Issue
Block a user