generated from nhcarrigan/template
b6d66d34cb
I can log in and create a book! Woo!
31 lines
873 B
TypeScript
31 lines
873 B
TypeScript
import {
|
|
ApplicationConfig,
|
|
provideBrowserGlobalErrorListeners,
|
|
APP_INITIALIZER,
|
|
} from '@angular/core';
|
|
import { provideRouter } from '@angular/router';
|
|
import { provideHttpClient, withInterceptors, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
import { appRoutes } from './app.routes';
|
|
import { AuthService } from './services/auth.service';
|
|
import { AuthInterceptor } from './interceptors/auth.interceptor';
|
|
import { initializeAuth } from './initializers/auth.initializer';
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideBrowserGlobalErrorListeners(),
|
|
provideRouter(appRoutes),
|
|
provideHttpClient(),
|
|
{
|
|
provide: HTTP_INTERCEPTORS,
|
|
useClass: AuthInterceptor,
|
|
multi: true
|
|
},
|
|
{
|
|
provide: APP_INITIALIZER,
|
|
useFactory: initializeAuth,
|
|
deps: [AuthService],
|
|
multi: true
|
|
}
|
|
],
|
|
};
|