Blazor app with can interface
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

using IOModuleTestBlazor;
using IOModuleTestBlazor.Components;
using IOModuleTestBlazor.Services;
var builder = WebApplication.CreateBuilder(args);
// ── CAN bus ───────────────────────────────────────────────────────────────────
builder.Services.AddSingleton<ICanService, CanService>();
builder.Services.AddHostedService<CanWorker>();
// ── Blazor ────────────────────────────────────────────────────────────────────
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
app.UseHsts();
}
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
app.UseHttpsRedirection();
app.UseAntiforgery();
app.MapStaticAssets();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();