Skip to content

Commit 65558cd

Browse files
committed
Make Environment.backendUrl optional
1 parent 156d7f1 commit 65558cd

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ import {ActionMenuComponent} from "./view/action-menu/action-menu/action-menu.co
204204
// and you send a request to these, the access token is appended.
205205
// Documentation:
206206
// https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/working-with-httpinterceptors.html
207-
allowedUrls: [environment.backendUrl],
207+
allowedUrls: environment.backendUrl ? [environment.backendUrl] : [],
208208
sendAccessToken: true,
209209
},
210210
}),
@@ -233,7 +233,7 @@ import {ActionMenuComponent} from "./view/action-menu/action-menu/action-menu.co
233233
],
234234
bootstrap: environment.customElement ? [] : [AppComponent],
235235
providers: [
236-
{provide: BASE_PATH, useValue: environment.backendUrl},
236+
... environment.backendUrl ? [{provide: BASE_PATH, useValue: environment.backendUrl}] : [],
237237
{provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true},
238238
],
239239
})

src/environments/environment.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {AuthConfig} from "angular-oauth2-oidc";
33
export interface Environment {
44
production: boolean;
55
label: string;
6-
backendUrl: string;
6+
backendUrl?: string;
77
authConfig?: AuthConfig;
88
disableBackend: boolean;
99
customElement: boolean;

src/environments/environment.standalone.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {Environment} from "./environment.model";
33
export const environment: Environment = {
44
production: false,
55
label: "standalone",
6-
backendUrl: "http://localhost:8080",
76
disableBackend: true,
87
customElement: true,
98
};

0 commit comments

Comments
 (0)