Skip to content

Commit

Permalink
Make Environment.backendUrl optional
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Jun 26, 2024
1 parent 156d7f1 commit 65558cd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ import {ActionMenuComponent} from "./view/action-menu/action-menu/action-menu.co
// and you send a request to these, the access token is appended.
// Documentation:
// https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/working-with-httpinterceptors.html
allowedUrls: [environment.backendUrl],
allowedUrls: environment.backendUrl ? [environment.backendUrl] : [],
sendAccessToken: true,
},
}),
Expand Down Expand Up @@ -233,7 +233,7 @@ import {ActionMenuComponent} from "./view/action-menu/action-menu/action-menu.co
],
bootstrap: environment.customElement ? [] : [AppComponent],
providers: [
{provide: BASE_PATH, useValue: environment.backendUrl},
... environment.backendUrl ? [{provide: BASE_PATH, useValue: environment.backendUrl}] : [],
{provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true},
],
})
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {AuthConfig} from "angular-oauth2-oidc";
export interface Environment {
production: boolean;
label: string;
backendUrl: string;
backendUrl?: string;
authConfig?: AuthConfig;
disableBackend: boolean;
customElement: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/environments/environment.standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {Environment} from "./environment.model";
export const environment: Environment = {
production: false,
label: "standalone",
backendUrl: "http://localhost:8080",
disableBackend: true,
customElement: true,
};

0 comments on commit 65558cd

Please sign in to comment.