@piggly/fastify-chassis
Version:
An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.
36 lines • 1.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpSecureServer = void 0;
const tslib_1 = require("tslib");
const fastify_1 = tslib_1.__importDefault(require("fastify"));
const AbstractServer_1 = require("./AbstractServer.js");
/**
* @file The API server.
* @copyright Piggly Lab 2023
*/
class HttpSecureServer extends AbstractServer_1.AbstractServer {
/**
* Create a new API server.
*
* @param options The options.
* @public
* @constructor
* @memberof ApiServer
* @since 1.0.0
* @author Caique Araujo <caique@piggly.com.br>
*/
constructor(options, ssl, fastifyOptions) {
super(options, (0, fastify_1.default)(fastifyOptions || {
disableRequestLogging: options.env.environment === 'production',
https: {
cert: ssl.cert,
key: ssl.key,
},
logger: options.fastify.logger ||
AbstractServer_1.AbstractServer.defaultLogger(options.env.environment, options.env.app.root_path, options.env.debug),
trustProxy: true,
}));
}
}
exports.HttpSecureServer = HttpSecureServer;
//# sourceMappingURL=HttpSecureServer.js.map