Open pekspro opened 1 month ago
I'm playing with the code and I think the correct way to the application should be:
dotnet serve --port 5200 --directory bin/Release/net8.0/publish/wwwroot --fallback-file index.html
But this will give me an error saying that index.html
doesn't exists. I guess it looks in the current directory, not in the directory provided by the directory
argument. Everything works if I remove the [FileExists]
attribute on the FallbackFile
property.
Should we make the path relative to the value of --directory
here?
@natemcmaster, no, that is not necessary. It already uses works as it is :-) MapFallbackToFile
is relative to the directory that is hosted as I understand it.
Describe the bug I'm trying to use
fallback-file
with a Blazor webassembly application. I get 404 when I'm loading URL:s that should return the fallback page.This is related to https://github.com/natemcmaster/dotnet-serve/issues/104.
To Reproduce Steps to reproduce the behavior:
Create, publish and host a Blazor Webassembly application like this:
Navigate to
http://localhost:5200/
and click on counter page. This works fine.Now, navigate to
http://localhost:5200/counter
. 404 is returned, but the content in index.html was expected.Logs