@piggly/fastify-chassis
Version:
An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.
31 lines • 959 B
JavaScript
import fastify from 'fastify';
import { AbstractServer } from './AbstractServer.js';
/**
* @file The API server.
* @copyright Piggly Lab 2023
*/
export class HttpSecureServer extends 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, fastify(fastifyOptions || {
disableRequestLogging: options.env.environment === 'production',
https: {
cert: ssl.cert,
key: ssl.key,
},
logger: options.fastify.logger ||
AbstractServer.defaultLogger(options.env.environment, options.env.app.root_path, options.env.debug),
trustProxy: true,
}));
}
}
//# sourceMappingURL=HttpSecureServer.js.map