inceptum
Version:
hipages take on the foundational library for enterprise-grade apps written in NodeJS
60 lines • 3.06 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ElasticsearchPlugin_1 = require("../elasticsearch/ElasticsearchPlugin");
const HealthCheckPlugin_1 = require("../health/HealthCheckPlugin");
const AdminPortPlugin_1 = require("../web/AdminPortPlugin");
const MysqlPlugin_1 = require("../mysql/MysqlPlugin");
const PostgresPlugin_1 = require("../postgres/PostgresPlugin");
const RabbitmqConsumerPlugin_1 = require("../rabbitmq/RabbitmqConsumerPlugin");
const RabbitmqProducerPlugin_1 = require("../rabbitmq/RabbitmqProducerPlugin");
const NewrelicPlugin_1 = require("../newrelic/NewrelicPlugin");
const SqsClientPlugin_1 = require("../sqs/SqsClientPlugin");
const SqsWorkerPlugin_1 = require("../sqs/SqsWorkerPlugin");
const BaseApp_1 = require("./BaseApp");
const AutowirePlugin_1 = require("./plugin/AutowirePlugin");
const DecoratorPlugin_1 = require("./plugin/DecoratorPlugin");
const LazyLoadingPlugin_1 = require("./plugin/LazyLoadingPlugin");
const StartStopPlugin_1 = require("./plugin/StartStopPlugin");
class InceptumApp extends BaseApp_1.default {
/**
* Creates a new Inceptum App
*/
constructor(options = {}) {
super(options);
// Standard IOC plugins.
this.register(new AutowirePlugin_1.default(), new LazyLoadingPlugin_1.default(), new StartStopPlugin_1.default(), new DecoratorPlugin_1.default(), new AdminPortPlugin_1.default(), new HealthCheckPlugin_1.default(), new NewrelicPlugin_1.default());
// TODO This is for backward compat, I'd like to remove it and be explicit
if (this.hasConfig('mysql')) {
this.logger.debug('Mysql Detected - Adding Plugin');
this.register(new MysqlPlugin_1.default());
}
if (this.hasConfig('postgres')) {
this.logger.debug('Postgres Detected - Adding Plugin');
this.register(new PostgresPlugin_1.default());
}
if (this.hasConfig('SqsClient')) {
this.logger.debug('SqsClient Detected - Adding Plugin');
this.register(new SqsClientPlugin_1.default());
}
if (this.hasConfig('SqsWorker')) {
this.logger.debug('SqsWorker Detected - Adding Plugin');
this.register(new SqsWorkerPlugin_1.default());
}
if (this.hasConfig('elasticsearch')) {
this.logger.debug('elasticsearch Detected - Adding Plugin');
this.register(new ElasticsearchPlugin_1.default());
}
if (this.hasConfig('rabbitmq.client')) {
if (this.hasConfig('rabbitmq.consumer')) {
this.logger.debug('rabbitmq consumer Detected - Adding Plugin');
this.register(new RabbitmqConsumerPlugin_1.default());
}
if (this.hasConfig('rabbitmq.producer')) {
this.logger.debug('rabbitmq producer Detected - Adding Plugin');
this.register(new RabbitmqProducerPlugin_1.default());
}
}
}
}
exports.InceptumApp = InceptumApp;
//# sourceMappingURL=InceptumApp.js.map