🐛 Fix sphere webpage load issue

This commit is contained in:
2025-08-04 02:58:08 +08:00
parent b7f853d84f
commit 6524a56eeb
3 changed files with 11 additions and 1 deletions

View File

@@ -7,3 +7,5 @@ bun.lock
package-lock.json package-lock.json
.DS_Store .DS_Store
wwwroot/dist

View File

@@ -71,7 +71,6 @@
<ItemGroup> <ItemGroup>
<Folder Include="Discovery\"/> <Folder Include="Discovery\"/>
<Folder Include="wwwroot\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -6,6 +6,7 @@ using DysonNetwork.Sphere;
using DysonNetwork.Sphere.PageData; using DysonNetwork.Sphere.PageData;
using DysonNetwork.Sphere.Startup; using DysonNetwork.Sphere.Startup;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.FileProviders;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@@ -51,4 +52,12 @@ app.ConfigureAppMiddleware(builder.Configuration);
app.MapGatewayProxy(); app.MapGatewayProxy();
app.UseDefaultFiles();
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(app.Environment.ContentRootPath, "wwwroot", "dist"))
});
app.MapPages(Path.Combine(app.Environment.WebRootPath, "dist", "index.html"));
app.Run(); app.Run();