migrations
This commit is contained in:
@@ -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: []
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user