"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
const _node = require("@sentry/node");
const _serverenv = require("./server.env");
const _servercore = require("./server.core");
const _containertokens = require("./container.tokens");
const _logger = require("./handlers/logger");
const _staticlogger = require("./handlers/logging/static.logger");
(0, _staticlogger.createStaticLogger)({
    enableFileLogs: true
});
const logger = new _logger.LoggerService("FDM-Environment");
logger.log("✓ Parsed environment with (optional) .env file, created static logger");
(0, _serverenv.setupEnvConfig)();
process.on("uncaughtException", (err)=>{
    logger.error("Uncaught exception", err);
});
process.on("unhandledRejection", (reason)=>{
    logger.error("Unhandled promise rejection", reason);
});
(0, _servercore.setupServer)().then(({ httpServer, container })=>{
    container.resolve(_containertokens.DITokens.serverHost).boot(httpServer).catch(async (e)=>{
        console.error("Server has crashed unintentionally - please report this", e);
        (0, _node.captureException)(e);
        await (0, _node.flush)(0);
        process.exit(1);
    });
});

//# sourceMappingURL=index.js.map