Skip to content

Bugfix for Saturn to Giraffe guide manifesting as issue in bundled app #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

jwthomson
Copy link
Contributor

Issue #362

This fix swaps out app.UseStaticFiles() for app.UseFileServer().

This effectively adds the behaviour of app.UseDefaultFiles() which will serve up /index.html upon request to /.

More info:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-8.0#usefileserver-for-default-documents

@jwthomson
Copy link
Contributor Author

This is roughly equivalent to Saturn's use_static which calls UseDefaultFile and UseStaticFiles - but a bit simpler.

For reference: https://github.com/SaturnFramework/Saturn/blob/4ae4d6126a6c7c0e91bded2ddbe1103030010c78/src/Saturn/Application.fs#L357

@mattgallagher92 mattgallagher92 merged commit 6463bf8 into master Aug 16, 2024
@mattgallagher92 mattgallagher92 deleted the saturn-to-giraffe-fix branch August 16, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants