35 lines
753 B
TypeScript
35 lines
753 B
TypeScript
// import './demo/index.ts';
|
|
// import { app as adminApp, appendTo } from './admin/index.ts';
|
|
import './routes/index.ts';
|
|
import { app } from './app.ts';
|
|
import { useConfig } from '@kevisual/use-config';
|
|
import { createAuthRoute } from '@kevisual/auth';
|
|
const config = useConfig<{ tokenSecret: string }>();
|
|
|
|
createAuthRoute({
|
|
app,
|
|
secret: config.tokenSecret,
|
|
});
|
|
|
|
// app.importApp(adminApp);
|
|
|
|
// appendTo(app);
|
|
|
|
app
|
|
.route({
|
|
path: 'test',
|
|
key: 'test',
|
|
})
|
|
.define(async (ctx) => {
|
|
ctx.body = app.router.routes.map((item) => {
|
|
return {
|
|
path: item.path,
|
|
key: item.key,
|
|
description: item.description,
|
|
validator: item.validator,
|
|
// schema: item.schema,
|
|
};
|
|
});
|
|
})
|
|
.addTo(app);
|