From 8ec300ac5c40afd56f8b6506b203677287110d8f Mon Sep 17 00:00:00 2001 From: Face <69168154+face-hh@users.noreply.github.com> Date: Fri, 30 May 2025 14:35:59 +0300 Subject: [PATCH] Update cluster-server.js --- cluster-server.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cluster-server.js b/cluster-server.js index 785d616..9103142 100644 --- a/cluster-server.js +++ b/cluster-server.js @@ -1,6 +1,6 @@ import cluster from 'cluster'; import { cpus } from 'os'; -import { handler } from './build/server/index.js'; +import { Server } from './build/server/index.js'; import express from 'express'; const numCPUs = cpus().length; @@ -14,9 +14,13 @@ if (cluster.isPrimary) { }); } else { const app = express(); - app.use(handler); + + const server = new Server(); + + app.use(server.handler); + const port = process.env.PORT || 3000; app.listen(port, () => console.log(`Worker ${process.pid} listening on ${port}`) ); -} +} \ No newline at end of file