Merge pull request #8 from bdfin/add-about-page
Use local host API base if in dev env
This commit is contained in:
@@ -7,10 +7,18 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|||||||
builder.RootComponents.Add<App>("#app");
|
builder.RootComponents.Add<App>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
|
|
||||||
var apiBase = builder.Configuration["ApiBase"]
|
string apiBase;
|
||||||
|
if (builder.HostEnvironment.IsDevelopment())
|
||||||
|
{
|
||||||
|
apiBase = builder.Configuration["ApiBase"]
|
||||||
?? throw new ArgumentException("API base address not found in config.");
|
?? throw new ArgumentException("API base address not found in config.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
apiBase = builder.HostEnvironment.BaseAddress;
|
||||||
|
}
|
||||||
|
|
||||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(apiBase) });
|
||||||
|
|
||||||
builder.Services.AddSingleton<ITypewriterNotificationService, TypewriterNotificationService>();
|
builder.Services.AddSingleton<ITypewriterNotificationService, TypewriterNotificationService>();
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="js/smoothScroll.js"></script>
|
<script src="js/smoothScroll.js"></script>
|
||||||
<script src="_framework/blazor.webassembly.js"></script>
|
<script src="_framework/blazor.webassembly.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user