mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-18 15:42:54 +00:00
refactor: parameterize configureApp function (inject db list)
Reason: easier testing (mocking) and better readability Note: did additional refactoring
This commit is contained in:
committed by
Rainer Killinger
parent
f3b86f0f0d
commit
fe7dd09d7e
@@ -17,6 +17,7 @@ import {Logger} from '@openstapps/logger';
|
||||
import express from 'express';
|
||||
import http from 'http';
|
||||
import {configureApp} from './app';
|
||||
import {Elasticsearch} from './storage/elasticsearch/elasticsearch';
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -95,7 +96,7 @@ function onListening() {
|
||||
Logger.ok(`Listening on ${bind}`);
|
||||
}
|
||||
|
||||
configureApp(app)
|
||||
configureApp(app, {elasticsearch: Elasticsearch})
|
||||
.then(() => {
|
||||
Logger.ok('Successfully configured express server');
|
||||
// After app setup listen on provided port, on all network interfaces
|
||||
|
||||
Reference in New Issue
Block a user