diff --git a/src/index.ts b/src/index.ts index 7305eaa..61376e9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ import 'dotenv/config' import { Hono } from 'hono' +import { cors } from 'hono/cors' import { serve } from '@hono/node-server' import { createNodeWebSocket } from '@hono/node-ws' import authRoutes from './routes/auth.js' @@ -12,6 +13,15 @@ import createT2LiveRoutes from './routes/t2live.js' const app = new Hono() const { upgradeWebSocket, injectWebSocket } = createNodeWebSocket({ app }) +app.use( + '*', + cors({ + origin: ['https://expria.app', 'http://localhost:5173'], + allowMethods: ['GET', 'POST', 'OPTIONS'], + allowHeaders: ['Content-Type', 'Authorization'], + }) +) + app.get('/', (c) => { return c.json({ message: 'Expria API — OK' }, 200) })