fix: add static file routes for OG image and favicons

This commit is contained in:
Oussama Douhou
2026-01-10 23:57:15 +01:00
parent 897a8281a7
commit 6aa6307d0e

View File

@@ -425,6 +425,41 @@ app.get('/app.js', async (c) => {
});
});
app.get('/og-image.png', async (c) => {
const file = Bun.file('./src/frontend/og-image.png');
return new Response(file, {
headers: { 'Content-Type': 'image/png' }
});
});
app.get('/favicon.svg', async (c) => {
const file = Bun.file('./src/frontend/favicon.svg');
return new Response(file, {
headers: { 'Content-Type': 'image/svg+xml' }
});
});
app.get('/favicon.ico', async (c) => {
const file = Bun.file('./src/frontend/favicon.ico');
return new Response(file, {
headers: { 'Content-Type': 'image/x-icon' }
});
});
app.get('/favicon.png', async (c) => {
const file = Bun.file('./src/frontend/favicon.png');
return new Response(file, {
headers: { 'Content-Type': 'image/png' }
});
});
app.get('/apple-touch-icon.png', async (c) => {
const file = Bun.file('./src/frontend/apple-touch-icon.png');
return new Response(file, {
headers: { 'Content-Type': 'image/png' }
});
});
// Serve index.html for all other routes (SPA fallback)
app.get('/', async (c) => {
const file = Bun.file('./src/frontend/index.html');