feat: Implement LiveCode module with WebSocket and SSE support
- Added config management using `useConfig` for environment variables. - Created `LiveCode` class to manage WebSocket connections and routing. - Implemented `SSEManager` for Server-Sent Events handling. - Developed `WSSManager` for managing WebSocket connections with heartbeat functionality. - Introduced `ReconnectingWebSocket` class for robust WebSocket client with automatic reconnection. - Added test files for live application demonstrating WebSocket and TCP server integration.
This commit is contained in:
10
assistant/src/module/config.ts
Normal file
10
assistant/src/module/config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { useConfig } from '@kevisual/use-config';
|
||||
import { HomeConfigDir } from './assistant/config/index.ts';
|
||||
import path from 'node:path';
|
||||
export const config = useConfig({
|
||||
dotenvOpts: {
|
||||
path: [path.join(HomeConfigDir, '.env'), '.env'],
|
||||
}
|
||||
})
|
||||
|
||||
// console.log('配置文件目录:', config, HomeConfigDir);
|
||||
Reference in New Issue
Block a user