"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const env_1 = require("@things-factory/env");
const headless_pool_for_process_1 = require("./controllers/headless-pool-for-process");
const internal_process_view_router_1 = require("./routers/internal-process-view-router");
const standalone_process_service_router_1 = require("./routers/standalone-process-service-router");
const isPathBaseDomain = !env_1.config.get('subdomain') && !env_1.config.get('useVirtualHostBasedDomain');
process.on('bootstrap-module-global-public-route', (app, domainGlobalPublicRouter) => {
    (0, headless_pool_for_process_1.getHeadlessPool)();
    domainGlobalPublicRouter.use('', internal_process_view_router_1.internalProcessViewRouter.routes(), internal_process_view_router_1.internalProcessViewRouter.allowedMethods());
});
process.on('bootstrap-module-domain-private-route', (app, domainPrivateRouter) => {
    if (isPathBaseDomain) {
        domainPrivateRouter.use('/domain/:domain', standalone_process_service_router_1.standaloneProcessServiceRouter.routes(), standalone_process_service_router_1.standaloneProcessServiceRouter.allowedMethods());
    }
    else {
        domainPrivateRouter.use('', standalone_process_service_router_1.standaloneProcessServiceRouter.routes(), standalone_process_service_router_1.standaloneProcessServiceRouter.allowedMethods());
    }
});
//# sourceMappingURL=routes.js.map