"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const YAML = require("yaml");
const fs_1 = require("fs");
const os_1 = require("os");
const CONFIG_FILE = process.env.NODE_ENV === 'production' ? process.cwd() + '/config.yaml' : './config.yaml';
const Config = YAML.parse((0, fs_1.readFileSync)(CONFIG_FILE, 'utf8')) || {};
Config.cacheRoot = Config.cacheRoot || `${(0, os_1.tmpdir)()}/rtsp-proxy/caches`;
if ((0, fs_1.existsSync)(Config.cacheRoot)) {
    (0, fs_1.rmdirSync)(Config.cacheRoot, { recursive: true });
}
(0, fs_1.mkdirSync)(Config.cacheRoot, { recursive: true });
Config.assetRoot = Config.assetRoot || './assets';
exports.default = Config;
