feat: add load types

This commit is contained in:
2024-11-10 21:12:45 +08:00
parent 2bbf3983c1
commit 696be2a28c
14 changed files with 356 additions and 217 deletions

View File

@@ -5,13 +5,14 @@ import { redisPublisher, redisSubscriber, redis } from './modules/redis.ts';
import { neode, getSession } from './modules/neo4j.ts';
import { minioClient } from './modules/minio.ts';
import { sequelize } from './modules/sequelize.ts';
useConfig();
export const emit = (channel: string, message?: any) => {
redisPublisher.publish(channel, JSON.stringify(message));
};
export { neode, getSession, redis, minioClient, sequelize };
export const app = new App<{ import: any; emit: typeof emit }>({
export const app = new App<{ import: any; emit: typeof emit; sequelize: typeof sequelize }>({
serverOptions: {
cors: {
origin: '*',
@@ -21,6 +22,7 @@ export const app = new App<{ import: any; emit: typeof emit }>({
routerContext: {
import: dynamicImport,
emit,
sequelize,
},
// routerHandle(res) {
// console.log('routerHandle', res.query);