feat: add Container and Page Module
This commit is contained in:
27
src/route.ts
27
src/route.ts
@@ -1,28 +1,3 @@
|
||||
import { router } from './modules/router.ts';
|
||||
|
||||
import './demo/index.ts';
|
||||
import './admin/index.ts';
|
||||
|
||||
import { dynamicImport } from './lib/dynamic-import.ts';
|
||||
|
||||
type Message = {
|
||||
path: string;
|
||||
key?: string;
|
||||
};
|
||||
|
||||
export const handleMessage = async function (m: Message) {
|
||||
if (!m) {
|
||||
return {
|
||||
code: 400,
|
||||
message: 'message is empty',
|
||||
};
|
||||
}
|
||||
|
||||
const res = await router.parse(m, {
|
||||
// @ts-ignore
|
||||
import: dynamicImport,
|
||||
});
|
||||
const { code, body, message } = res;
|
||||
// console.log('response', res);
|
||||
return { code, data: body, message };
|
||||
};
|
||||
import './routes/index.ts';
|
||||
Reference in New Issue
Block a user