/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { FrontcraftAppModule } from './app/app.module';
import { environment } from './environments/environment';
import { IApiService } from "./app/frontcraft/services/ApiService/ApiService"
import { ClientApiService } from './app/frontcraft/services/ApiService/client-login-api';
import { LoggerService } from './app/frontcraft/services/LoggerService/logger.service';

if (environment.production) {
  enableProdMode();
}
const loggerService = new LoggerService()
const serviceObj = new ClientApiService(loggerService)
serviceObj.initialize().then(_ => {
  platformBrowserDynamic([
    {
      provide: IApiService,
      deps: [],
      useValue: serviceObj
    },{
      provide: LoggerService,
      deps: [],
      useValue: loggerService
    }
  ]).bootstrapModule(FrontcraftAppModule)
    .catch(err => console.error(err));
})
