Guides (Marty 2026-11-17): /guides index plus How a hunt works, Is PolHunter legit (reward wallet 0x90EC...A753 on Polygonscan, live ledger), Free account and FAQ, facts from lib/rewards.js and live settings; Guides link in nav and footers; /sitemap.xml and /robots.txt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-17 08:24:55 -06:00
parent 3709d91f59
commit 408a30cf31
8 changed files with 227 additions and 4 deletions
+11
View File
@@ -271,6 +271,17 @@ const server = http.createServer(async (req, res) => {
if (p === '/leaders') return sendFile(res, path.join(PUBLIC_DIR, 'leaders.html'));
if (p === '/promo') return sendFile(res, path.join(PUBLIC_DIR, 'promo.html'));
if (p === '/terms' || p === '/privacy' || p === '/disclaimer') return sendFile(res, path.join(PUBLIC_DIR, p.slice(1) + '.html')); // legal pages (2026-11-17)
// evergreen Guides (Marty 2026-11-17): /guides and four pages, static files in public/guides
const GUIDES = ['how-a-hunt-works', 'is-polhunter-legit', 'free-account', 'faq'];
if (p === '/guides' || p === '/guides/') return sendFile(res, path.join(PUBLIC_DIR, 'guides', 'index.html'));
{ const gm = /^\/guides\/([a-z-]+)\/?$/.exec(p); if (gm && GUIDES.includes(gm[1])) return sendFile(res, path.join(PUBLIC_DIR, 'guides', gm[1] + '.html')); }
if (p === '/sitemap.xml') { // the public pages (2026-11-17)
const day = new Date().toISOString().slice(0, 10);
const urls = ['/', '/leaders', '/promo', '/guides', ...GUIDES.map(g => '/guides/' + g), '/terms', '/disclaimer', '/privacy'].map(x => '<url><loc>' + SITE + x + '</loc><lastmod>' + day + '</lastmod></url>').join('');
res.writeHead(200, Object.assign({ 'Content-Type': 'application/xml; charset=utf-8', 'Cache-Control': 'public, max-age=3600' }, SEC));
return res.end('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + urls + '</urlset>');
}
if (p === '/robots.txt') { res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'public, max-age=3600' }); return res.end('User-agent: *\nDisallow: /app\nDisallow: /admin\nSitemap: ' + SITE + '/sitemap.xml\n'); }
if (p === '/api/ledger') { const t = rewards.totals(); return json(res, 200, { totals: t, referrals: referrals.totals(), pools: { finds: rewards.pool(), referral: referrals.refPool() }, recent: rewards.ledger(30).map(x => ({ who: x.username ? '@' + x.username : '#' + x.memberId, site: x.site, pol: x.pol, tx: x.tx, at: x.paidAt })) }); }
// ---- hunter (session required)