[frontend] Add provider for BASE_URL

This commit is contained in:
Cathy Hu 2020-08-17 16:08:32 +02:00
parent c928532c44
commit 5b1bbfa24e
2 changed files with 4 additions and 2 deletions

View file

@ -12,6 +12,8 @@ import { HoodpageComponent } from './hoodpage/hoodpage.component';
import { HoodspageComponent } from './hoodspage/hoodspage.component';
import { ApiModule } from './api/api.module';
import { HttpClientModule } from '@angular/common/http';
import { BASE_PATH } from './api/variables';
import { environment } from 'src/environments/environment';
@NgModule({
declarations: [
@ -30,7 +32,7 @@ import { HttpClientModule } from '@angular/common/http';
ApiModule,
HttpClientModule,
],
providers: [],
providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
bootstrap: [AppComponent],
})
export class AppModule {}

View file

@ -4,7 +4,7 @@
export const environment = {
production: false,
backendUrl: 'http://localhost:8000/api',
API_BASE_PATH: 'http://localhost:8000',
};
/*