From 9fe54c5d21b525b41cb59d40cea510db5f683efe Mon Sep 17 00:00:00 2001 From: sbwalker Date: Wed, 31 Jan 2024 16:12:53 -0500 Subject: [PATCH] remove commented code and add SignalR options --- Oqtane.Server/Startup.cs | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index f79561e2..f4576ee9 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -68,18 +68,6 @@ namespace Oqtane services.AddOptions>().Bind(Configuration.GetSection(SettingKeys.AvailableDatabasesSection)); services.Configure(opts => opts.ShutdownTimeout = TimeSpan.FromSeconds(10)); // increase from default of 5 seconds - //services.AddServerSideBlazor() - // .AddCircuitOptions(options => - // { - // if (_env.IsDevelopment()) - // { - // options.DetailedErrors = true; - // } - // }) - // .AddHubOptions(options => { - // options.MaximumReceiveMessageSize = null; // no limit (for large amnounts of data ie. textarea components) - // }); - // setup HttpClient for server side in a client side compatible fashion ( with auth cookie ) services.AddHttpClients(); @@ -153,7 +141,16 @@ namespace Oqtane .ConfigureOqtaneMvc(); // any additional configuration from IStartup classes services.AddRazorComponents() - .AddInteractiveServerComponents() + .AddInteractiveServerComponents(options => + { + if (_env.IsDevelopment()) + { + options.DetailedErrors = false; + } + }).AddHubOptions(options => + { + options.MaximumReceiveMessageSize = null; // no limit (for large amnounts of data ie. textarea components) + }) .AddInteractiveWebAssemblyComponents(); services.AddSwaggerGen(options => @@ -208,14 +205,7 @@ namespace Oqtane app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/" + Constants.Version + "/swagger.json", Constants.PackageId + " " + Constants.Version); }); } - //app.UseEndpoints(endpoints => - //{ - // endpoints.MapBlazorHub(); - // endpoints.MapControllers(); - // endpoints.MapFallbackToPage("/_Host"); - //}); - - app.UseAntiforgery(); + //app.UseAntiforgery(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); @@ -225,8 +215,7 @@ namespace Oqtane { endpoints.MapRazorComponents() .AddInteractiveServerRenderMode() - .AddInteractiveWebAssemblyRenderMode() - .AddAdditionalAssemblies(typeof(SiteRouter).Assembly); + .AddInteractiveWebAssemblyRenderMode(); }); app.UseEndpoints(endpoints =>