Skip UseFileServer when wwwroot is missing.
Local Aspire has no published client folder; the middleware warned on every boot. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -159,7 +159,11 @@ app.Map("/ws/game", async (HttpContext context, GameSocketHandler handler, Sessi
|
||||
app.MapDefaultEndpoints();
|
||||
|
||||
// In a published container the built client lands in wwwroot next to the server.
|
||||
app.UseFileServer();
|
||||
// Local Aspire has no such folder — Vite serves the UI, and UseFileServer would warn.
|
||||
if (ClientStaticFiles.CanServe(app.Environment.WebRootPath))
|
||||
{
|
||||
app.UseFileServer();
|
||||
}
|
||||
|
||||
app.Run();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user