Skip to content

Commit

Permalink
hard code baseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 20, 2024
1 parent f7f807c commit 70883b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions MyApp.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
builder.Services.AddCascadingAuthenticationState();
builder.Services.AddSingleton<AuthenticationStateProvider, PersistentAuthenticationStateProvider>();

var baseUrl = "https://blazor-wasm.web-templates.io";

// Use / for local or CDN resources
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(baseUrl) });

var apiBaseUrl = builder.Configuration["ApiBaseUrl"] ?? builder.HostEnvironment.BaseAddress;
builder.Services.AddBlazorApiClient(apiBaseUrl);
builder.Services.AddBlazorApiClient(baseUrl);
builder.Services.AddLocalStorage();

await builder.Build().RunAsync();
2 changes: 1 addition & 1 deletion MyApp.Client/RedirectToLogin.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
@code {
protected override void OnInitialized()
{
NavigationManager.NavigateTo($"https://blazor-wasm.web-templates.io/Account/Login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true);
NavigationManager.NavigateTo($"Account/Login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true);
}
}

0 comments on commit 70883b6

Please sign in to comment.