🐛 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

@@ -6,6 +6,7 @@ using DysonNetwork.Sphere;
using DysonNetwork.Sphere.PageData;
using DysonNetwork.Sphere.Startup;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.FileProviders;
var builder = WebApplication.CreateBuilder(args);
@@ -51,4 +52,12 @@ app.ConfigureAppMiddleware(builder.Configuration);
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();