feat: routes api

This commit is contained in:
DIYgod 2024-03-14 20:08:57 +08:00
parent 901075eda9
commit 63639a44d1
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,9 @@
import { Hono } from 'hono';
import rules from '@/api/radar/rules';
import routes from '@/api/routes';
const app = new Hono();
app.get('/radar/rules.json', rules);
app.get('/radar/rules', rules);
app.get('/routes', routes);
export default app;

6
lib/api/routes/index.ts Normal file
View File

@ -0,0 +1,6 @@
import type { Handler } from 'hono';
import { namespaces } from '@/registry';
const handler: Handler = (ctx) => ctx.json(namespaces);
export default handler;