Bri*_*der 5 routes asp.net-core blazor-webassembly
The solution has a web-api project that is also the host for a blazor-webassembly front-end.
With this config all works fine. WebApi endpoint get hit correctly when called from postman.
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapRazorPages();
});
Run Code Online (Sandbox Code Playgroud)
When adding a MapFallBackToFile suddenly some Api-Endpoint do not get hit anymore but serve that default file.
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapRazorPages();
endpoints.MapFallbackToFile("index.html");
});
Run Code Online (Sandbox Code Playgroud)
The reason for adding this fallback : serve as landing page for the Blazor front-end.
Any suggestions ?
| 归档时间: |
|
| 查看次数: |
7190 次 |
| 最近记录: |