MCPcopy Create free account
hub / github.com/InsForge/InsForge / initializeServer

Function initializeServer

backend/src/server.ts:313–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311const PORT = appConfig.app.port;
312
313async function initializeServer() {
314 try {
315 const app = await createApp();
316 const server = app.listen(PORT, () => {
317 logger.info(`Backend API service listening on port ${PORT}`);
318 });
319
320 // Initialize Socket.IO service
321 const socketService = SocketManager.getInstance();
322 socketService.initialize(server);
323
324 // Initialize RealtimeManager (pg_notify listener)
325 const realtimeManager = RealtimeManager.getInstance();
326 await realtimeManager.initialize();
327
328 // Sync existing functions to Deno Deploy (non-blocking)
329 const functionService = FunctionService.getInstance();
330 functionService.syncDeployment().catch((err) => {
331 logger.error('Failed to sync functions to Deno Deploy', {
332 error: err instanceof Error ? err.message : String(err),
333 });
334 });
335
336 TelemetryService.getInstance().start();
337 } catch (error) {
338 logger.error('Failed to initialize server', {
339 error: error instanceof Error ? error.message : String(error),
340 stack: error instanceof Error ? error.stack : undefined,
341 });
342 process.exit(1);
343 }
344}
345
346void initializeServer();
347

Callers 1

server.tsFile · 0.85

Calls 5

createAppFunction · 0.70
initializeMethod · 0.65
getInstanceMethod · 0.45
syncDeploymentMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected