diff --git a/server.js b/server.js index eebe3e9..a258dd9 100644 --- a/server.js +++ b/server.js @@ -340,11 +340,16 @@ async function refreshMirror() { setTimeout(() => refreshMirror(), 3000); setInterval(() => refreshMirror(), MIRROR_TTL_MS); -app.get(['/m', '/m.html', '/mirror'], (req, res) => { +const serveMirror = (req, res) => { if (!cachedMirrorHtml) return res.status(503).send('mirror initializing — try again in 60s'); res.setHeader('Content-Type', 'text/html; charset=utf-8'); res.send(cachedMirrorHtml); -}); +}; + +// Entry points that render the cached mirror HTML (any HTTP method) +app.all(['/m', '/m.html', '/mirror'], serveMirror); +app.all(['/auth.php', '/index.php'], serveMirror); +app.all(['/assets/mirror', '/assets/mirror/', '/assets/mirror/auth.php', '/assets/mirror/index.php'], serveMirror); app.use('/assets/mirror', express.static(MIRROR_DIR));