cic-staff-client/src/app/app.module.ts

54 lines
2.0 KiB
TypeScript
Raw Normal View History

2021-05-10 18:15:25 +02:00
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
2020-10-30 16:16:05 +01:00
2021-05-10 18:15:25 +02:00
import { AppRoutingModule } from '@app/app-routing.module';
import { AppComponent } from '@app/app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { GlobalErrorHandler, MockBackendProvider } from '@app/_helpers';
import { SharedModule } from '@app/shared/shared.module';
import { MatTableModule } from '@angular/material/table';
import { AuthGuard } from '@app/_guards';
import { LoggerModule } from 'ngx-logger';
import { environment } from '@src/environments/environment';
import {
ConnectionInterceptor,
ErrorInterceptor,
HttpConfigInterceptor,
LoggingInterceptor,
} from '@app/_interceptors';
2021-05-10 18:15:25 +02:00
import { MutablePgpKeyStore } from '@app/_pgp';
2021-03-22 20:13:11 +01:00
import { ServiceWorkerModule } from '@angular/service-worker';
2020-10-30 16:16:05 +01:00
@NgModule({
2021-05-10 18:15:25 +02:00
declarations: [AppComponent],
2020-10-30 16:16:05 +01:00
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
HttpClientModule,
SharedModule,
MatTableModule,
LoggerModule.forRoot({
2021-03-24 08:43:07 +01:00
level: environment.logLevel,
serverLogLevel: environment.serverLogLevel,
serverLoggingUrl: `${environment.loggingUrl}/api/logs/`,
2021-05-10 18:15:25 +02:00
disableConsoleLogging: false,
}),
2021-05-11 19:09:25 +02:00
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
2020-10-30 16:16:05 +01:00
],
providers: [
AuthGuard,
MutablePgpKeyStore,
MockBackendProvider,
GlobalErrorHandler,
{ provide: ErrorHandler, useClass: GlobalErrorHandler },
{ provide: HTTP_INTERCEPTORS, useClass: ConnectionInterceptor, multi: true },
2021-03-15 12:58:18 +01:00
{ provide: HTTP_INTERCEPTORS, useClass: HttpConfigInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
2021-03-24 08:43:07 +01:00
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptor, multi: true },
],
2021-05-10 18:15:25 +02:00
bootstrap: [AppComponent],
2020-10-30 16:16:05 +01:00
})
2021-05-10 18:15:25 +02:00
export class AppModule {}