mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Fix ASP0014 warning: Use top-level route registration for ElectronHub
Changed from app.UseEndpoints() pattern to direct app.MapHub() call, following modern ASP.NET Core conventions. This removes the analyzer warning while maintaining the same functionality.
This commit is contained in:
@@ -65,14 +65,11 @@ app.UseStaticFiles();
|
||||
|
||||
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
|
||||
|
||||
// UseAntiforgery must be between UseRouting and UseEndpoints
|
||||
// UseAntiforgery must be after UseRouting
|
||||
app.UseAntiforgery();
|
||||
|
||||
// Use endpoints for SignalR hub
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapHub<ElectronNET.AspNet.Hubs.ElectronHub>("/electron-hub");
|
||||
});
|
||||
// Map SignalR hub for Electron communication
|
||||
app.MapHub<ElectronNET.AspNet.Hubs.ElectronHub>("/electron-hub");
|
||||
|
||||
app.MapStaticAssets();
|
||||
app.MapRazorComponents<ElectronNET.Samples.BlazorSignalR.Components.App>()
|
||||
|
||||
Reference in New Issue
Block a user