UNPKG

proxrox

Version:

Proxy services, combine origins, use SSI and more during development

32 lines (31 loc) 1.57 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.setDefaults = void 0; var uuid_1 = require("uuid"); var path_1 = __importDefault(require("path")); function setDefaults(config) { var _a, _b, _c, _d, _e, _f, _g, _h; return { serverName: config.serverName || 'example', port: config.port || 4000, root: (_a = config.root) !== null && _a !== void 0 ? _a : process.cwd(), logDir: config.logDir || 'logs', tmpDir: config.tmpDir || path_1.default.join('/tmp', 'proxrox', (0, uuid_1.v4)()), http2: (_b = config.http2) !== null && _b !== void 0 ? _b : false, stubStatus: (_c = config.stubStatus) !== null && _c !== void 0 ? _c : false, ssi: (_d = config.ssi) !== null && _d !== void 0 ? _d : false, gzip: (_e = config.gzip) !== null && _e !== void 0 ? _e : true, directoryIndex: (_f = config.directoryIndex) !== null && _f !== void 0 ? _f : true, standardServer: (_g = config.standardServer) !== null && _g !== void 0 ? _g : true, extraSite: config.extraSite || '', proxy: config.proxy || [], proxyReadTimeout: config.proxyReadTimeout || '60s', tls: (_h = config.tls) !== null && _h !== void 0 ? _h : false, tlsCertificateFile: config.tlsCertificateFile || '', tlsCertificateKeyFile: config.tlsCertificateKeyFile || '', }; } exports.setDefaults = setDefaults;