21 lines
605 B
TypeScript
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; |