UNPKG

@gabliam/web-core

Version:
48 lines (47 loc) 1.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebPluginBaseConfig = void 0; const tslib_1 = require("tslib"); const core_1 = require("@gabliam/core"); const constants_1 = require("./constants"); let WebPluginBaseConfig = class WebPluginBaseConfig { constructor() { this.rootPath = '/'; this.port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000; this.verbose = true; } restConfig() { return { rootPath: this.rootPath, port: this.port, hostname: this.hostname, verbose: this.verbose, }; } }; tslib_1.__decorate([ (0, core_1.Value)('application.web.rootPath', core_1.Joi.string()), tslib_1.__metadata("design:type", Object) ], WebPluginBaseConfig.prototype, "rootPath", void 0); tslib_1.__decorate([ (0, core_1.Value)('application.web.port', core_1.Joi.number().positive()), tslib_1.__metadata("design:type", Number) ], WebPluginBaseConfig.prototype, "port", void 0); tslib_1.__decorate([ (0, core_1.Value)('application.web.hostname', core_1.Joi.string()), tslib_1.__metadata("design:type", String) ], WebPluginBaseConfig.prototype, "hostname", void 0); tslib_1.__decorate([ (0, core_1.Value)('application.web.verbose', core_1.Joi.bool()), tslib_1.__metadata("design:type", Object) ], WebPluginBaseConfig.prototype, "verbose", void 0); tslib_1.__decorate([ (0, core_1.Bean)(constants_1.WEB_PLUGIN_CONFIG), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", Object) ], WebPluginBaseConfig.prototype, "restConfig", null); WebPluginBaseConfig = tslib_1.__decorate([ (0, core_1.PluginConfig)() ], WebPluginBaseConfig); exports.WebPluginBaseConfig = WebPluginBaseConfig;