mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 09:08:11 +00:00
a9012a6613
## Description: Reverts #49b01d8 Move cloudflare tunnel creation back into startup.sh. This keeps the infra outside of the main app. ## Please complete the following: - [ ] I have added screenshots for all UI updates - [ ] I process any text displayed to the user through translateText() and I've added it to the en.json file - [ ] I have added relevant tests to the test directory - [ ] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
27 lines
709 B
TypeScript
27 lines
709 B
TypeScript
import cluster from "cluster";
|
|
import * as dotenv from "dotenv";
|
|
import { startMaster } from "./Master";
|
|
import { startWorker } from "./Worker";
|
|
|
|
// Load environment variables before we read configuration values derived from them.
|
|
dotenv.config();
|
|
|
|
// 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);
|
|
});
|