Skip to content

Commit

Permalink
fix fallback static file handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Dec 12, 2023
1 parent f505682 commit cda9933
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion MyApp/Components/Pages/Docs.razor
@@ -1,4 +1,4 @@
@page "/{Slug?}"
@page "/{Slug:regex(^[a-z-_]+$)}"
@inherits AppComponentBase
@inject MarkdownPages Markdown
@inject AppConfig AppConfig
Expand Down
4 changes: 1 addition & 3 deletions MyApp/Configure.AppHost.cs
Expand Up @@ -19,9 +19,7 @@ public class AppHost : AppHostBase, IHostingStartup
public override void Configure(Container container)
{
SetConfig(new HostConfig {
IgnorePathInfoPrefixes = { "/appsettings", "/_framework" },
});

Config.AllowFileExtensions.Add("json");
Config.AllowFileExtensions.Add("dat");
}
}
5 changes: 0 additions & 5 deletions MyApp/Program.cs
Expand Up @@ -82,11 +82,6 @@
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(Counter).Assembly);

// Add support for serving static *.json files from WebAssembly
IResult StaticJsonFile(HttpContext context) => Results.File(context.Request.Path.Value![1..], MimeTypes.Json);
app.MapGet("/appsettings.json", StaticJsonFile);
app.MapGet("/appsettings.Development.json", StaticJsonFile);

// Add additional endpoints required by the Identity /Account Razor components.
app.MapAdditionalIdentityEndpoints();

Expand Down

0 comments on commit cda9933

Please sign in to comment.