|
|
@@ -2,7 +2,7 @@ export class BootConfigResult {
|
|
|
private constructor(public bootConfig: BootJsonData, public applicationEnvironment: string) {
|
|
|
}
|
|
|
|
|
|
- static async initAsync(): Promise<BootConfigResult> {
|
|
|
+ static async initAsync(environment?: string): Promise<BootConfigResult> {
|
|
|
const bootConfigResponse = await fetch('_framework/blazor.boot.json', {
|
|
|
method: 'GET',
|
|
|
credentials: 'include',
|
|
|
@@ -10,8 +10,8 @@ export class BootConfigResult {
|
|
|
});
|
|
|
|
|
|
// While we can expect an ASP.NET Core hosted application to include the environment, other
|
|
|
- // hosts may not. Assume 'Production' in the absenc of any specified value.
|
|
|
- const applicationEnvironment = bootConfigResponse.headers.get('Blazor-Environment') || 'Production';
|
|
|
+ // hosts may not. Assume 'Production' in the absence of any specified value.
|
|
|
+ const applicationEnvironment = environment || bootConfigResponse.headers.get('Blazor-Environment') || 'Production';
|
|
|
const bootConfig: BootJsonData = await bootConfigResponse.json();
|
|
|
|
|
|
return new BootConfigResult(bootConfig, applicationEnvironment);
|