diff --git a/frontend/public/docs/BOTFIGHTS.md b/frontend/public/docs/BOTFIGHTS.md index d5482e8..d9cbd8d 100644 --- a/frontend/public/docs/BOTFIGHTS.md +++ b/frontend/public/docs/BOTFIGHTS.md @@ -7,8 +7,8 @@ Your AI reads this file to set up a fighting bot for BOTFIGHTS. Follow the instr You should have received these from BOTFIGHTS registration: ``` -BOT_ID=your_bot_id -BOT_SECRET=your_bot_secret +BOT_ID=YOUR_BOT_ID +BOT_SECRET=YOUR_BOT_SECRET ``` If the user provided credentials above, use those values. If not, ask the user for them. diff --git a/server/src/app.ts b/server/src/app.ts index 22f8a69..1a62597 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -125,6 +125,7 @@ if (process.env.NODE_ENV === 'production' && existsSync(publicDir)) { wav: 'audio/wav', mp3: 'audio/mpeg', ogg: 'audio/ogg', + md: 'text/markdown', } function serveFile(c: Context, reqPath: string, cacheControl: string) { @@ -163,6 +164,9 @@ if (process.env.NODE_ENV === 'production' && existsSync(publicDir)) { app.get('/icon.svg', (c) => serveFile(c, '/icon.svg', 'public, max-age=86400')) app.get('/apple-touch-icon.png', (c) => serveFile(c, '/apple-touch-icon.png', 'public, max-age=86400')) + // Docs (markdown setup guides) + app.get('/docs/*', (c) => serveFile(c, c.req.path, 'public, max-age=3600')) + // Audio files (pre-generated TTS, SFX) app.get('/audio/*', (c) => serveFile(c, c.req.path, 'public, max-age=86400')) // SPA fallback: only for navigation requests (not JS/CSS/asset files) @@ -170,7 +174,7 @@ if (process.env.NODE_ENV === 'production' && existsSync(publicDir)) { if (c.req.path.startsWith('/api/')) return c.notFound() // Don't serve index.html for asset requests — return 404 so the browser gets a proper error const ext = c.req.path.split('.').pop() - if (ext && ext !== c.req.path && ['js', 'css', 'map', 'json', 'png', 'jpg', 'svg', 'woff', 'woff2', 'webp', 'ico', 'wav', 'mp3', 'ogg'].includes(ext)) { + if (ext && ext !== c.req.path && ['js', 'css', 'map', 'json', 'png', 'jpg', 'svg', 'woff', 'woff2', 'webp', 'ico', 'wav', 'mp3', 'ogg', 'md'].includes(ext)) { return c.notFound() } const indexPath = join(publicDir, 'index.html')