2025-08-03 19:05:43 +02:00
|
|
|
using PresentPortal.Shared;
|
2025-07-06 19:15:24 +02:00
|
|
|
using PresentPortal.Web;
|
|
|
|
|
using PresentPortal.Web.Components;
|
|
|
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
// Add service defaults & Aspire client integrations.
|
|
|
|
|
builder.AddServiceDefaults();
|
|
|
|
|
builder.AddRedisOutputCache("cache");
|
|
|
|
|
|
|
|
|
|
// Add services to the container.
|
|
|
|
|
builder.Services.AddRazorComponents()
|
|
|
|
|
.AddInteractiveServerComponents();
|
|
|
|
|
|
|
|
|
|
builder.Services.AddHttpClient<WeatherApiClient>(client =>
|
|
|
|
|
{
|
|
|
|
|
// This URL uses "https+http://" to indicate HTTPS is preferred over HTTP.
|
|
|
|
|
// Learn more about service discovery scheme resolution at https://aka.ms/dotnet/sdschemes.
|
2025-08-03 19:05:43 +02:00
|
|
|
client.BaseAddress = new($"https+http://{ServiceNames.Api}");
|
2025-07-06 19:15:24 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
|
|
|
{
|
|
|
|
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
|
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
|
|
|
app.UseHsts();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
|
|
|
|
|
app.UseAntiforgery();
|
|
|
|
|
|
|
|
|
|
app.UseOutputCache();
|
|
|
|
|
|
|
|
|
|
app.MapStaticAssets();
|
|
|
|
|
|
|
|
|
|
app.MapRazorComponents<App>()
|
|
|
|
|
.AddInteractiveServerRenderMode();
|
|
|
|
|
|
|
|
|
|
app.MapDefaultEndpoints();
|
|
|
|
|
|
|
|
|
|
app.Run();
|