mirror of https://github.com/abpframework/abp.git
20 changed files with 139 additions and 148 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,63 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Routing; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using MyCompanyName.MyProjectName.Blazor.Host.Client; |
|||
using Volo.Abp; |
|||
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Bundling; |
|||
using Volo.Abp.AspNetCore.Components.WebAssembly.WebApp; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Blazor.Host; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpAutofacModule), |
|||
typeof(AbpAspNetCoreMvcUiBundlingModule), |
|||
typeof(AbpAspNetCoreComponentsWebAssemblyThemingBundlingModule) |
|||
)] |
|||
public class MyProjectNameBlazorHostModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
//https://github.com/dotnet/aspnetcore/issues/52530
|
|||
Configure<RouteOptions>(options => |
|||
{ |
|||
options.SuppressCheckForUnhandledSecurityMetadata = true; |
|||
}); |
|||
|
|||
// Add services to the container.
|
|||
context.Services.AddRazorComponents() |
|||
.AddInteractiveWebAssemblyComponents(); |
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
var env = context.GetEnvironment(); |
|||
var app = context.GetApplicationBuilder(); |
|||
|
|||
// Configure the HTTP request pipeline.
|
|||
if (env.IsDevelopment()) |
|||
{ |
|||
app.UseWebAssemblyDebugging(); |
|||
} |
|||
else |
|||
{ |
|||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|||
app.UseHsts(); |
|||
} |
|||
|
|||
app.UseHttpsRedirection(); |
|||
app.UseStaticFiles(); |
|||
app.UseRouting(); |
|||
app.UseAntiforgery(); |
|||
|
|||
app.UseConfiguredEndpoints(builder => |
|||
{ |
|||
builder.MapRazorComponents<App>() |
|||
.AddInteractiveWebAssemblyRenderMode() |
|||
.AddAdditionalAssemblies(WebAppAdditionalAssembliesHelper.GetAssemblies<MyProjectNameBlazorHostClientModule>()); |
|||
}); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue