migrations

This commit is contained in:
peter
2020-03-25 23:49:54 +01:00
parent b28f8bc7ce
commit 9ff98d92ae
62 changed files with 711 additions and 483 deletions
+8 -3
View File
@@ -13,7 +13,7 @@ global['document'] = win.document;
global['alert'] = console.log
global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
export async function attachExpress(app, staticDir = "./dist") {
export async function attachExpress(app, staticDir = "./dist", loggerService = console) {
const STATIC_FOLDER = resolve(process.cwd(), staticDir);
enableProdMode();
@@ -21,7 +21,7 @@ export async function attachExpress(app, staticDir = "./dist") {
const bundle = require(staticDir + '/server/main');
const ServerApiService = bundle.ServerApiService
const serviceObj = new ServerApiService()
const serviceObj = new ServerApiService(loggerService)
await serviceObj.initialize()
app.set('view engine', 'html');
@@ -31,10 +31,15 @@ export async function attachExpress(app, staticDir = "./dist") {
bootstrap: bundle.AppServerModuleNgFactory,
providers: [
provideModuleMap(bundle.LAZY_MODULE_MAP),
{
provide: bundle.LoggerService,
deps: [],
useValue: loggerService
},
{
provide: bundle.IApiService,
deps: [],
useValue: serviceObj,
deps: []
}
]
})