-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Description
Describe the bug
API_BASE_URL is not resolved. This is an issue when running the application in IIS within another application in a folder.
To Reproduce
Remove the @optional tag in de web-api-client.ts
Run the application
See the console for the error
Expected behavior
When running under a folder the application should work
Screenshots
Additional context
Possible solution:
In main.ts add provider for API_BASE_URL
export function getApiBaseUrl() {
var url = document.getElementsByTagName('base')[0].href;
if (url.endsWith('/')) {
url = url.substring(0, url.length - 1);
}
return url;
}
const providers = [
{ provide: 'BASE_URL', useFactory: getBaseUrl, deps: [] },
{ provide: API_BASE_URL, useFactory: getApiBaseUrl }
];
Metadata
Metadata
Assignees
Labels
No labels