dotnet / dotnet/aspnetcore

[Static assets] MapFallback method for MapStaticAssets

Open
#64,827 1 comment 1 reaction 0 assignees View on GitHub
area-blazor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

We want the equivalent to `MapFallbackToStaticFiles`, but we want to implement it differently.

The API can be something like the following:
```csharp
app.MapStaticAssets()
.MapFallbackTo("index.html");
```
Not sure if it should be based on the "file path" or on the endpoint path (which 99% of the time match). The API would identify all the endpoints that target `index.html` and would add an additional variant with a catch-all route.

Alternatively, we can do this at the SDK level by identifying the endpoints that target index.html and adding a fallback endpoint. The goal here is to avoid having to call MapFallbackToFile on Blazor's dev server.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.