Expectation:
Hit localhost:5000 in your browser and see the default todo app.
Actual result:
Hit localhost:5000 in your browser and get a 404 error.
The fact that the application does work in dev mode dotnet run but fails once bundled - indicates to me that there is an an inconsistency with the way Vite handles incoming requests vs how Kestrel/IIS handles incoming requests.
I think the difference in behaviour is due to Kestrel is not remapping root requests to index.html by default. In contrast, Vite defaults to serving index.html for root requests. (and this seems to be non-negotiable! https://vitejs.dev/guide/#index-html-and-project-root)
For me, the workaround posted in Discord - renaming the public folder to wwwroot - did not work.
Someone on the F# discord mentioned that the guide for switching from Saturn to Giraffe did not work for them.
Repro steps:
Expectation: Hit
localhost:5000
in your browser and see the default todo app.Actual result: Hit
localhost:5000
in your browser and get a 404 error.The fact that the application does work in dev mode
dotnet run
but fails once bundled - indicates to me that there is an an inconsistency with the way Vite handles incoming requests vs how Kestrel/IIS handles incoming requests.I think the difference in behaviour is due to Kestrel is not remapping root requests to
index.html
by default. In contrast, Vite defaults to servingindex.html
for root requests. (and this seems to be non-negotiable! https://vitejs.dev/guide/#index-html-and-project-root)For me, the workaround posted in Discord - renaming the
public
folder towwwroot
- did not work.Working on a PR to fix.