"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.configureApp = configureApp;
const ServerFactory_1 = require("./ServerFactory");
function configureApp(app) {
    (0, ServerFactory_1.rememberApp)(app);
    if (app.config.ytInterfaceSecret) {
        // Check if file is loadable
        // eslint-disable-next-line security/detect-non-literal-require
        require(app.config.ytInterfaceSecret);
    }
    if (app.config.clustersConfigPath) {
        // check if file is loadable
        // eslint-disable-next-line security/detect-non-literal-require
        require(app.config.clustersConfigPath);
    }
    if (app.config.appDevMode) {
        const sourceMaps = require('source-map-support');
        sourceMaps.install();
    }
    // Log YT response times for all requests
    const yt = require('@ytsaurus/javascript-wrapper')();
    yt.subscribe('requestEnd', (config) => {
        app.nodekit.ctx.log('yt-javascript-wrapper request completed', config.meta);
    });
}
