This commit is contained in:
Jonathan Jenne
2023-08-23 12:42:03 +02:00
parent b312396bb5
commit 3ecd9ecb27
44 changed files with 1549 additions and 56 deletions

View File

@@ -0,0 +1,41 @@
using EnvelopeGenerator.Web.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
var builder = WebApplication.CreateBuilder(args);
// Add basic blazor services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
// Add custom services
builder.Services.AddSingleton<LoggingService>();
builder.Services.AddTransient<DatabaseService>();
builder.Services.AddLocalization();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
//app.UseHsts();
}
// Redirect http:// to https://
//app.UseHttpsRedirection();
// Serve static assets like css
app.UseStaticFiles();
// Add a router
app.UseRouting();
// Blazor plumbing
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
// Get crackin'!
app.Run();