app-s01qyw/backend/src/index.ts
2026-09-29 20:05:51 +05:30

21 lines
605 B
TypeScript

import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { AppContext } from './utils';
import publicRoutes from './routes/public';
import adminRoutes from './routes/admin';
import { agentic } from './routes/external';
const app = new Hono<AppContext>();
app.use('*', cors({
origin: '*',
allowHeaders: ['Content-Type', 'Authorization', 'X-MAuth-Token', 'x-mworld-origin', 'mAuthAgenticToken'],
allowMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS']
}));
app.route('/', agentic);
app.route('/api', publicRoutes);
app.route('/api/admin', adminRoutes);
export default app;