refactor: Modularize server into separate concerns
Split monolithic index.ts (~1400 lines) into modular structure: - config.ts: Server configuration and constants - db/: Database initialization, migrations, and seeds - routes/: API handlers by domain (themes, canvas, components, etc.) - services/: Terminal WebSocket server - utils/: CORS helpers Entry point now only coordinates initialization.
This commit is contained in:
13
server/config.ts
Normal file
13
server/config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Server configuration
|
||||
export const PORT_HTTP = 4101
|
||||
export const PORT_TERMINAL = 4103
|
||||
|
||||
// Terminal configuration
|
||||
export const WORKING_DIR = process.cwd().replace(/[\\\/]server$/, '')
|
||||
export const SHELL = process.platform === 'win32' ? 'powershell.exe' : 'bash'
|
||||
export const SHELL_ARGS = process.platform === 'win32' ? ['-NoLogo', '-NoProfile'] : []
|
||||
export const DEFAULT_SESSION_ID = 'main'
|
||||
export const MAX_BUFFER_LINES = 1000
|
||||
|
||||
// Database
|
||||
export const DB_PATH = 'agent-ui.db'
|
||||
Reference in New Issue
Block a user