mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-12-22 12:28:21 -05:00
31 lines
681 B
C#
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();
|