Add Kestrel re-execute for @Aareksio

This commit is contained in:
JustArchi
2018-09-13 21:28:18 +02:00
parent 794ddab08c
commit 48eb6fae20
2 changed files with 8 additions and 3 deletions

View File

@@ -40,6 +40,7 @@
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="2.0.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.8.7" />
<PackageReference Include="Humanizer" Version="2.4.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.2.0-preview1-35029" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.2.0-preview1-35029" />
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0-preview1-35029" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0-preview1-35029" />

View File

@@ -61,12 +61,16 @@ namespace ArchiSteamFarm.IPC {
// We need WebSockets support for /Api/Log
app.UseWebSockets();
// We need MVC for /Api
app.UseMvcWithDefaultRoute();
// This will re-execute all definitions specified below to WWW root, we need this for 404 URLs such as /login -> /index.html
// It's nice to note that entries above (such as our /Api provided by MVC) is not affected by this, only static files
app.UseStatusCodePagesWithReExecute("/");
// We need static files support for IPC GUI
app.UseDefaultFiles();
app.UseStaticFiles();
// We need MVC for /Api
app.UseMvcWithDefaultRoute();
}
public void ConfigureServices(IServiceCollection services) {