32 lines
898 B
TypeScript
32 lines
898 B
TypeScript
import { ApplicationConfig } from '@angular/core';
|
|
import { provideRouter } from '@angular/router';
|
|
|
|
import { routes } from './app.routes';
|
|
import { provideHttpClient } from '@angular/common/http';
|
|
import { BASE_PATH } from 'recettes-ng-client';
|
|
import { environment } from '../environments/environment';
|
|
import { ApiModule, Configuration } from 'recettes-ng-client';
|
|
import { AuthService } from './auth.service';
|
|
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
{
|
|
provide: BASE_PATH, useValue: environment.apiUrl
|
|
},
|
|
{
|
|
provide: Configuration,
|
|
useFactory: (authService: AuthService) => new Configuration(
|
|
{
|
|
basePath: environment.apiUrl,
|
|
accessToken: authService.getAccessToken.bind(authService)
|
|
}
|
|
),
|
|
deps: [AuthService],
|
|
multi: false
|
|
},
|
|
provideRouter(routes),
|
|
provideHttpClient()
|
|
]
|
|
};
|