Update wwwroot content
Use OnMappingFailed to deal with client routing Disable content caching for update
This commit is contained in:
parent
14261c8e29
commit
01710f1857
@ -4,7 +4,7 @@ namespace GCLocalServerRewrite.common;
|
||||
|
||||
public static class Configs
|
||||
{
|
||||
public const bool USE_FILE_CACHE = true;
|
||||
public const bool USE_FILE_CACHE = false;
|
||||
|
||||
public const string ROOT_CA_CN = "Taito Arcade Machine CA";
|
||||
|
||||
|
@ -46,8 +46,16 @@ public class Server
|
||||
.WithStaticFolder(Configs.STATIC_BASE_ROUTE, PathHelper.HtmlRootPath, true, m => m
|
||||
.WithContentCaching(Configs.USE_FILE_CACHE))
|
||||
// Add static files after other modules to avoid conflicts
|
||||
.WithStaticFolder("/", PathHelper.HtmlRootPath, true, m => m
|
||||
.WithContentCaching(Configs.USE_FILE_CACHE))
|
||||
.WithStaticFolder("/", PathHelper.HtmlRootPath, true, m =>
|
||||
{
|
||||
m.WithContentCaching(Configs.USE_FILE_CACHE);
|
||||
m.OnMappingFailed = async (context, info) =>
|
||||
{
|
||||
var htmlContents = await File.ReadAllTextAsync(Path.Combine(PathHelper.HtmlRootPath, "index.html"));
|
||||
context.Response.StatusCode = 200;
|
||||
await context.SendStringAsync(htmlContents, "text/html", Encoding.UTF8);
|
||||
};
|
||||
})
|
||||
.WithModule(new ActionModule("/", HttpVerbs.Any,
|
||||
ctx => ctx.SendDataAsync(new { Message = "Error" })));
|
||||
server.AddCustomMimeType(".dll", "application/octet-stream");
|
||||
|
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<BlazorEnableCompression>false</BlazorEnableCompression>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@ -14,6 +15,11 @@
|
||||
<RunAOTCompilation>False</RunAOTCompilation>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
|
||||
<TrimmerSingleWarn>false</TrimmerSingleWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="GenFu" Version="1.6.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.4" />
|
||||
@ -31,14 +37,23 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
<Content Update="wwwroot\data\avatar.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\data\avatar.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
<Content Update="wwwroot\data\navigator.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\data\navigator.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
<Content Update="wwwroot\data\title.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\data\title.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
@ -53,5 +68,4 @@
|
||||
<Folder Include="Utils" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
BIN
MudAdmin/wwwroot/data/avatar.dat
Normal file
BIN
MudAdmin/wwwroot/data/avatar.dat
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
MudAdmin/wwwroot/data/navigator.dat
Normal file
BIN
MudAdmin/wwwroot/data/navigator.dat
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
11704
MudAdmin/wwwroot/data/title.dat
Normal file
11704
MudAdmin/wwwroot/data/title.dat
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user