Training center: new members-area pane for videos + materials

New "Training" nav pane lists curated lessons (inline video for mp4/webm, links
for external videos and docs) from /api/training (admin-curated via
data/training.json, with a sensible default).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-07 08:41:26 -05:00
parent 42d0e15fea
commit 31a6560e9e
3 changed files with 45 additions and 3 deletions
+11
View File
@@ -728,6 +728,17 @@ const server = http.createServer(async (req, res) => {
accounts.touchSeen(s.email).catch(() => {});
return json(res, 200, { ok: true, chatUnread: await messages.chatUnread(s.email) });
}
// training center content (admin-curated via data/training.json)
if (p === '/api/training' && req.method === 'GET') {
const s = await auth.fromRequest(req);
if (!s) return json(res, 401, { error: 'Sign in first.' });
let items = [];
try { const j = JSON.parse(fs.readFileSync(path.join(DATA_DIR, 'training.json'), 'utf8')); if (Array.isArray(j)) items = j; } catch (e) {}
if (!items.length) items = [{ title: 'Getting started with InstantAdPay',
desc: 'How the platform works, how every payout splits on-chain to real wallets, and how to build your line.',
docUrl: 'https://instantadpay.com/' }];
return json(res, 200, { items });
}
// daily login bonus (once/day, gentle streak) — granted after the login flow
if (p === '/api/my/login-bonus' && req.method === 'POST') {
const s = await auth.fromRequest(req);