2024-02-19 12:54:56 +00:00
|
|
|
using KeymailSpecials2.Components;
|
2024-03-18 09:19:07 +00:00
|
|
|
using KeymailSpecials2.Components.Services;
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
internal class Program
|
|
|
|
{
|
|
|
|
private static void Main(string[] args)
|
|
|
|
{
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddRazorComponents()
|
|
|
|
.AddInteractiveServerComponents();
|
|
|
|
|
|
|
|
builder.Services.AddSingleton<GlobalService>(); // Global variables shared by all users
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
var app = builder.Build();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
// Configure the HTTP request pipeline.
|
|
|
|
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();
|
|
|
|
}
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
app.UseHttpsRedirection();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
app.UseStaticFiles();
|
|
|
|
app.UseAntiforgery();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
app.MapRazorComponents<App>()
|
|
|
|
.AddInteractiveServerRenderMode();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
app.Run();
|
|
|
|
}
|
|
|
|
}
|