From 5b1bbfa24e5ad6b19bb15e94a0b78b1f16818d3b Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Mon, 17 Aug 2020 16:08:32 +0200 Subject: [PATCH] [frontend] Add provider for BASE_URL --- kibicara-frontend/src/app/app.module.ts | 4 +++- kibicara-frontend/src/environments/environment.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kibicara-frontend/src/app/app.module.ts b/kibicara-frontend/src/app/app.module.ts index f2602a9..a225478 100644 --- a/kibicara-frontend/src/app/app.module.ts +++ b/kibicara-frontend/src/app/app.module.ts @@ -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 {} diff --git a/kibicara-frontend/src/environments/environment.ts b/kibicara-frontend/src/environments/environment.ts index 66485f9..da12efe 100644 --- a/kibicara-frontend/src/environments/environment.ts +++ b/kibicara-frontend/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - backendUrl: 'http://localhost:8000/api', + API_BASE_PATH: 'http://localhost:8000', }; /*