Hello there! I noticed that the resource/file handlers of reitit serve index files with redirects, so I made a little PR with an additional option to also allow serving them directly: https://github.com/metosin/reitit/pull/725! I'm now searching for a way to avoid serving index files when no trailing slash exists (e.g. /sample should not serve /sample/index.html but /sample/ should) is there already something for this or should I make another PR?
there's a redirect-based approach to slashes: https://github.com/metosin/reitit/blob/master/doc/ring/slash_handler.md
I'll try to find time to look at the PR at some point
yes this approach is for treating paths without slashes the same as paths with slashes, e.g. when we need /sample to serve the same thing as /sample/
The above for some reason seems to be the default functionality for resource/file handlers when serving index files which is in my opinion counter-intuitive (given the explicitness of paths in regular router)
I would expect when having a /sample/ resource/asset directory the /sample to return 404 and /sample/ to return the matching index e.g. /sample/index.html (if we look at it semantically also, 'indexes' are for directories)
now both /sample and /sample/ return /sample/index.html
I made a branch that implements the above functionality too and will contribute in a separate PR as soon as the above PR merges to avoid conflicts 🙂