Admin: Refresh button + auto-refresh every minute, key kept in the browser so /admin reloads without it
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -144,7 +144,7 @@ const server = http.createServer(async (req, res) => {
|
||||
// ---- static + pages ----
|
||||
if (p === '/' || p === '/index.html') { if (curtained(req, res, u)) return; return sendFile(res, path.join(PUBLIC_DIR, 'index.html')); }
|
||||
if (p === '/play') return sendFile(res, path.join(PUBLIC_DIR, 'play.html'));
|
||||
if (p === '/admin') { if (!admin(req, u)) return page(res, 403, 'Admin', '<p>Key required.</p>'); return sendFile(res, path.join(PUBLIC_DIR, 'admin.html')); }
|
||||
if (p === '/admin') return sendFile(res, path.join(PUBLIC_DIR, 'admin.html')); // the page asks for the key; every /api/admin call checks it
|
||||
if (p === '/spawn.js') return sendFile(res, path.join(__dirname, 'lib', 'spawn.js'));
|
||||
if (/^\/[a-z0-9._-]+\.(css|js|png|jpg|svg|ico|webp|mp4)$/i.test(p) && !p.includes('..')) return sendFile(res, path.join(PUBLIC_DIR, p.slice(1)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user