Remove app.config.ts, integrate configuration directly in main.ts, and refactor providers to include authInterceptor.
This commit is contained in:
parent
e825d83124
commit
d73f057596
|
|
@ -1,18 +0,0 @@
|
||||||
import {ApplicationConfig, provideZoneChangeDetection} from '@angular/core';
|
|
||||||
import {provideRouter} from '@angular/router';
|
|
||||||
import {CookieService} from 'ngx-cookie-service';
|
|
||||||
|
|
||||||
import {routes} from './app.routes';
|
|
||||||
import {provideHttpClient, withInterceptors} from '@angular/common/http';
|
|
||||||
import {authInterceptor} from '@services/AuthInterceptor';
|
|
||||||
|
|
||||||
export const appConfig: ApplicationConfig = {
|
|
||||||
providers: [
|
|
||||||
provideZoneChangeDetection({eventCoalescing: true}),
|
|
||||||
provideRouter(routes),
|
|
||||||
CookieService,
|
|
||||||
provideHttpClient(
|
|
||||||
withInterceptors([authInterceptor])
|
|
||||||
),
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
@ -2,15 +2,19 @@ import {bootstrapApplication} from '@angular/platform-browser';
|
||||||
import {AppComponent} from './app/app.component';
|
import {AppComponent} from './app/app.component';
|
||||||
import {provideRouter} from '@angular/router';
|
import {provideRouter} from '@angular/router';
|
||||||
import {routes} from './app/app.routes';
|
import {routes} from './app/app.routes';
|
||||||
import {provideHttpClient} from '@angular/common/http';
|
import {provideHttpClient, withInterceptors} from '@angular/common/http';
|
||||||
import {BASE_PATH} from './api';
|
import {BASE_PATH} from '@api';
|
||||||
import {environment} from './environments/environment';
|
import {environment} from '@environment';
|
||||||
|
import {authInterceptor} from '@services/AuthInterceptor';
|
||||||
|
|
||||||
bootstrapApplication(AppComponent, {
|
bootstrapApplication(AppComponent, {
|
||||||
providers: [
|
providers: [
|
||||||
provideRouter(routes),
|
provideRouter(routes),
|
||||||
provideHttpClient(),
|
provideHttpClient(),
|
||||||
{provide: BASE_PATH, useValue: environment.apiUrl}
|
{provide: BASE_PATH, useValue: environment.apiUrl},
|
||||||
|
provideHttpClient(
|
||||||
|
withInterceptors([authInterceptor])
|
||||||
|
),
|
||||||
]
|
]
|
||||||
}).catch(err => console.error(err));
|
}).catch(err => console.error(err));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user