Added docker-compose. Updated startups for API and Web layer.
This commit is contained in:
@@ -10,9 +10,14 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
||||
string apiBase = builder.Configuration["ApiBaseUrl"] ?? builder.HostEnvironment.BaseAddress;
|
||||
//string apiBase = builder.Configuration["ApiBaseUrl"] ?? builder.HostEnvironment.BaseAddress;
|
||||
//Console.WriteLine(apiBase);
|
||||
|
||||
Console.WriteLine(apiBase);
|
||||
// If ApiBaseUrl is set (VS dev), use it. Otherwise (docker/prod), use same-origin.
|
||||
var apiBase = builder.Configuration["ApiBaseUrl"];
|
||||
|
||||
if (string.IsNullOrWhiteSpace(apiBase))
|
||||
apiBase = builder.HostEnvironment.BaseAddress;
|
||||
|
||||
// Old way
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(apiBase) });
|
||||
|
||||
Reference in New Issue
Block a user