Skip to content
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

Enable option for index.html to be a directories default #640

Merged
merged 1 commit into from
Jun 30, 2022

Conversation

ukd1
Copy link
Contributor

@ukd1 ukd1 commented Jun 29, 2022

Description of the Change

Sometimes (often?) when people serve static files, they may want "pretty urls" - e.g. "/welcome" vs "/welcome/index.html". This config option enables index.html to be the default if the request is for a folder and the file exists, otherwise it defaults to directory listing (if enabled).

Alternate Designs

I considered just doing it in my app directly, but I belive this is a useful & missing minor feature.

Benefits

Serving static html from pretty folders is now easy.

Possible Drawbacks

Except for the additional code, none I can think of as it's disabled by default. I'm acutally not sure where to document this though.

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @ukd1 👍 I think this is a valid use-case and maybe in the future we can make this the default behavio. Also we can document this at the Kemal guide https://github.com/kemalcr/kemalcr.com

@sdogruyol sdogruyol merged commit 05d5554 into kemalcr:master Jun 30, 2022
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.

2 participants