kotx / render

Cloudflare Worker to proxy and cache requests to R2
MIT License
384 stars 85 forks source link

Add support for directory listings #20

Closed Erisa closed 1 year ago

Erisa commented 1 year ago

Adds DIRECTORY_LISTING option disabled by default which allows listing files in a directory with a static HTML page, triggered when the path ends with /.

If there is an INDEX_FILE configured as well then it will be used instead and the listing will be a fallback,

Here's a flowchart of what the request flow should be like: Request flow

Also adds HIDE_HIDDEN_FILES disabled by default which will hide files and folders beginning with .

kotx commented 1 year ago

Just took a look at these changes, thanks a bunch for this! Finally closes #2 🎉 Might need a major version bump for this because / doesn't return OK anymore (for good reason). Or maybe I just want to reach 1.0, lol

Thanks again for the contribution, merged <3

P.S: That flowchart terrifies me, I like it!