feat: add functionality to register plugins via http

Also:

- Add functionality for serving the responses from plugins
- Add tests for related methods and routes

Closes #2, #37
This commit is contained in:
Jovan Krunić
2019-07-04 17:43:36 +02:00
committed by Rainer Killinger
parent 59ea7a5ba6
commit 3d51ccfac2
12 changed files with 3035 additions and 188 deletions

View File

@@ -174,7 +174,6 @@ export class Elasticsearch implements Database {
constructor(private readonly config: SCConfigFile, mailQueue?: MailQueue) {
if (typeof config.internal.database === 'undefined'
|| typeof config.internal.database.version === 'undefined'
|| typeof config.internal.database.version !== 'string') {
throw new Error('Database version is undefined. Check your config file');
}
@@ -182,14 +181,10 @@ export class Elasticsearch implements Database {
const options: ES.ConfigOptions = {
apiVersion: config.internal.database.version,
host: Elasticsearch.getElasticsearchUrl(),
log: 'error',
// enable verbose logging for all request to elasticsearch
log: process.env.ES_DEBUG === 'true' ? 'trace' : 'error',
};
// enable verbose logging for all request to elasticsearch
if (process.env.ES_DEBUG === 'true') {
options.log = 'trace';
}
this.client = new ES.Client(options);
this.aliasMap = {};
this.ready = false;