Browse Source
Use `StaticFiles` instead of `MapStaticAssets` in `Development`.
pull/21784/head
maliming
1 year ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
9 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs
|
|
|
@ -177,6 +177,15 @@ public static class AbpApplicationBuilderExtensions |
|
|
|
throw new AbpException("The app(IApplicationBuilder) is not an IEndpointRouteBuilder."); |
|
|
|
} |
|
|
|
|
|
|
|
var environment = endpoints.ServiceProvider.GetRequiredService<IWebHostEnvironment>(); |
|
|
|
if (environment.IsDevelopment()) |
|
|
|
{ |
|
|
|
app.UseStaticFiles(); |
|
|
|
// Volo.Abp.AspNetCore.staticwebassets.endpoints.json is a empty file.
|
|
|
|
// https://github.com/dotnet/aspnetcore/issues/59673
|
|
|
|
return endpoints.MapStaticAssets("Volo.Abp.AspNetCore.staticwebassets.endpoints.json"); |
|
|
|
} |
|
|
|
|
|
|
|
var options = app.ApplicationServices.GetRequiredService<IOptions<AbpAspNetCoreContentOptions>>().Value; |
|
|
|
foreach (var folder in options.AllowedExtraWebContentFolders) |
|
|
|
{ |
|
|
|
|