Add live reload on changes

This commit is contained in:
khalid@traclabs.com
2026-04-23 08:04:34 -05:00
parent 233fb6d003
commit 36fadf710d
9 changed files with 153 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import { createEditQueue } from './queue/edit-queue.js';
import { processEditJob } from './queue/process-edit-job.js';
import { openDb, closeDb, pruneExpiredProposals, pruneIdempotencyKeys } from './db.js';
import { logger } from './logger.js';
import { initLiveReload } from './live-reload.js';
const PORT = parseInt(process.env.ORCHESTRATOR_PORT || '3001', 10);
@@ -27,6 +28,9 @@ export async function startServer() {
logger.info({ event: 'server.started', port: PORT }, `Orchestrator listening on port ${PORT}`);
});
// Optional websocket for browser reload on content writes
initLiveReload(server);
// Graceful shutdown
let shuttingDown = false;
async function shutdown(signal: string) {