Files
serein-flow/Serein.CloudWorkbench/Program.cs
2025-03-14 16:04:06 +08:00

40 lines
964 B
C#

using Serein.CloudWorkbench.Components;
using Serein.CloudWorkbench.Services;
namespace Serein.CloudWorkbench
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
// ×¢²á CounterService ×÷Ϊµ¥Àý
builder.Services.AddSingleton<CounterService>();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();
}
}
}