From 5df9cb39d39580c5bc893efdb0cb116c4a948547 Mon Sep 17 00:00:00 2001 From: token <239573049@qq.com> Date: Fri, 20 Dec 2024 11:33:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9D=A1=E4=BB=B6=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/NuGet.Next/Program.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/NuGet.Next/Program.cs b/src/NuGet.Next/Program.cs index 7715938..a17500e 100644 --- a/src/NuGet.Next/Program.cs +++ b/src/NuGet.Next/Program.cs @@ -64,9 +64,20 @@ app.Use((async (context, next) => { + if (context.Request.Path == "/") + { + if (info.Exists) + { + await context.Response.SendFileAsync(Path.Combine("wwwroot", "index.html")); + } + + return; + } + await next(context); - if (context.Response.StatusCode == 404) + if (context.Response.StatusCode == 404 && context.Request.Path.StartsWithSegments("/v3") && + context.Request.Path.StartsWithSegments("/api")) { context.Response.StatusCode = 200;