22 lines
616 B
TypeScript
22 lines
616 B
TypeScript
import { NgModule } from '@angular/core';
|
|
import { ApiModule, Configuration } from 'recettes-ng-client';
|
|
import { AuthService } from './auth.service';
|
|
import { environment } from '../environments/environment';
|
|
|
|
@NgModule({
|
|
imports: [ ApiModule ],
|
|
providers: [
|
|
{
|
|
provide: Configuration,
|
|
useFactory: (authService: AuthService) => new Configuration(
|
|
{
|
|
basePath: environment.apiUrl,
|
|
accessToken: authService.getAccessToken.bind(authService)
|
|
}
|
|
),
|
|
deps: [AuthService],
|
|
multi: false
|
|
}
|
|
]
|
|
})
|
|
export class AppModule {} |