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.
68 lines
2.5 KiB
68 lines
2.5 KiB
namespace MyCompanyName.MyProjectName
|
|
{
|
|
[DependsOn(
|
|
typeof(MyProjectNameHttpApiModule),
|
|
typeof(AbpProAspNetCoreModule),
|
|
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
|
|
typeof(MyProjectNameEntityFrameworkCoreModule),
|
|
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
|
|
typeof(AbpAspNetCoreSerilogModule),
|
|
typeof(AbpAccountWebModule),
|
|
typeof(MyProjectNameApplicationModule),
|
|
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
|
|
typeof(AbpCachingStackExchangeRedisModule),
|
|
typeof(AbpSwashbuckleModule)
|
|
)]
|
|
public class MyProjectNameHttpApiHostModule : AbpModule
|
|
{
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
context.Services
|
|
.AddAbpProAuditLog()
|
|
.AddAbpProAuthentication()
|
|
.AddAbpProMultiTenancy()
|
|
.AddAbpProRedis()
|
|
.AddAbpProRedisDistributedLocking()
|
|
.AddAbpProMiniProfiler()
|
|
.AddAbpProCors()
|
|
.AddAbpProAntiForgery()
|
|
.AddAbpProIdentity()
|
|
.AddAbpProSignalR()
|
|
.AddAbpProHealthChecks()
|
|
.AddAbpProTenantResolvers()
|
|
.AddAbpProLocalization()
|
|
.AddAbpProExceptions()
|
|
.AddAbpProSwagger("AbpPro");
|
|
}
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|
{
|
|
var app = context.GetApplicationBuilder();
|
|
app.UseAbpProRequestLocalization();
|
|
app.UseCorrelationId();
|
|
app.MapAbpStaticAssets();
|
|
app.UseAbpProMiniProfiler();
|
|
app.UseRouting();
|
|
app.UseAbpProCors();
|
|
app.UseAuthentication();
|
|
app.UseAbpProMultiTenancy();
|
|
app.UseAuthorization();
|
|
app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json","AbpPro");
|
|
app.UseAbpProAuditing();
|
|
app.UseAbpSerilogEnrichers();
|
|
app.UseUnitOfWork();
|
|
app.UseConfiguredEndpoints(endpoints =>
|
|
{
|
|
endpoints.MapHealthChecks("/health");
|
|
|
|
// endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions()
|
|
// {
|
|
// Authorization = new[] { new CustomHangfireAuthorizeFilter() },
|
|
// IgnoreAntiforgeryToken = true
|
|
// });
|
|
|
|
});
|
|
app.UseAbpProConsul();
|
|
}
|
|
}
|
|
}
|