diff --git a/index.html b/index.html index 18a46c7..e74ab44 100644 --- a/index.html +++ b/index.html @@ -9,8 +9,8 @@
- - + + diff --git a/server/src/index.ts b/server/src/index.ts index fb1781e..4480259 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -61,6 +61,23 @@ app.get('/health', (_req, res) => { res.json({ ok: true }); }); +// Proxy external devv-app.js to avoid browser CORS for module scripts +app.get('/devv-app.js', async (_req, res) => { + try { + const response = await fetch('https://static.devv.ai/devv-app.js'); + if (!response.ok) { + res.status(response.status).type('text/plain').send(''); + return; + } + res.setHeader('Content-Type', 'application/javascript; charset=utf-8'); + res.setHeader('Cache-Control', 'public, max-age=3600'); + const bodyText = await response.text(); + res.send(bodyText); + } catch (error) { + res.status(502).type('application/javascript').send('// proxy error'); + } +}); + type DbRow = { id: string; product_code: string | null;