Minecraft-Realms-Emulator/Panel/Program.cs
2024-05-28 11:48:10 +02:00

31 lines
681 B
C#

using Panel.Components;
var builder = WebApplication.CreateBuilder(args);
DotNetEnv.Env.Load();
if (Environment.GetEnvironmentVariable("ADMIN_KEY") == null)
{
Console.WriteLine("ADMIN_KEY enviornment variable not found, exiting");
Environment.Exit(1);
}
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
}
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();