Files
OpenFrontIO/src/server/Server.ts
T
2025-03-02 09:39:09 -08:00

23 lines
572 B
TypeScript

import cluster from "cluster";
import { startMaster } from "./Master";
import { startWorker } from "./Worker";
// Main entry point of the application
async function main() {
// Check if this is the primary (master) process
if (cluster.isPrimary) {
console.log("Starting master process...");
await startMaster();
} else {
// This is a worker process
console.log("Starting worker process...");
await startWorker();
}
}
// Start the application
main().catch((error) => {
console.error("Failed to start server:", error);
process.exit(1);
});