"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const path_1=__importDefault(require("path")),fs_1=__importDefault(require("fs")),envPaths=[path_1.default.resolve(process.cwd(),".env"),path_1.default.resolve(__dirname,"../.env"),path_1.default.resolve(__dirname,".env"),path_1.default.resolve(process.cwd(),"../.env")];let envLoaded=!1;for(const e of envPaths)if(fs_1.default.existsSync(e)){require("dotenv").config({path:e});envLoaded=!0;break}envLoaded||require("dotenv").config();require("./module-alias-setup");const src_1=require("./src"),console_1=require("./src/utils/console"),port=process.env.NEXT_PUBLIC_BACKEND_PORT||4e3,startApp=async()=>{try{const e=new src_1.MashServer;await e.startServer(Number(port))}catch(e){console_1.console$.error("Failed to start server",e);console_1.logger.error("APP","Failed to initialize app",e);process.exit(1)}};startApp();