diff --git a/server.js b/server.js index 0aa6d08..7c6fcfc 100644 --- a/server.js +++ b/server.js @@ -1500,6 +1500,13 @@ const server = http.createServer(async (req, res) => { if (p === '/assets/pt.js' && isLinkHost(req)) return sendFile(res, path.join(PUBLIC_DIR, 'assets', 'pt.js')); // -- short link domains: a real small site (home, disclosure, terms, privacy, abuse) so the domain never looks parked if (isLinkHost(req)) { + // page-builder media (2026-10-30, Neville: images showed in Preview on linkspin.app but not on the live lookfirst.page link): + // a builder page is served on the link domain with relative image paths, so the niche library and member uploads must be + // reachable here too; same strict patterns as the main host, nothing else from public/ or the volume + let im = /^\/niches\/([a-z0-9-]{1,80}\.(?:jpg|jpeg|png|webp|gif))$/.exec(p); + if (im && (req.method === 'GET' || req.method === 'HEAD')) return sendFile(res, path.join(PUBLIC_DIR, 'niches', im[1])); + im = /^\/uploads\/([a-z0-9]{24}\.(?:png|jpg|webp|gif|mp4|webm))$/.exec(p); + if (im && (req.method === 'GET' || req.method === 'HEAD')) return sendFile(res, path.join(UPLOADS_DIR, im[1])); const page = { '/': 'home', '/disclosure': 'disclosure', '/terms': 'terms', '/privacy': 'privacy', '/abuse': 'abuse', '/robots.txt': 'robots' }[p]; if (!page) { res.writeHead(404, { 'Content-Type': 'text/html; charset=utf-8' }); return res.end(linkSitePage(reqHost(req), 'gone')); } if (page === 'robots') { res.writeHead(200, { 'Content-Type': 'text/plain' }); return res.end('User-agent: *\nDisallow: /r/\nDisallow: /c/\nDisallow: /s/\n'); }