feat: add redis

This commit is contained in:
2024-09-23 01:21:26 +08:00
parent a8f80abc88
commit 63df5ba800
4 changed files with 107 additions and 0 deletions

View File

@@ -1,8 +1,12 @@
import { App } from '@abearxiong/router';
import { useConfig } from '@abearxiong/use-config';
import { dynamicImport } from './lib/dynamic-import.ts';
import { redisPublisher } from './modules/redis.ts';
useConfig();
export const emit = (channel: string, message: string) => {
redisPublisher.publish(channel, message);
};
export const app = new App({
serverOptions: {
@@ -12,5 +16,6 @@ export const app = new App({
},
routerContext: {
import: dynamicImport,
emit,
},
});