pkulchenko / fullmoon

Fast and minimalistic Redbean-based Lua web framework in one file.
MIT License
684 stars 30 forks source link

[Suggestion] Disable Listing #17

Closed evandrodacs closed 1 year ago

evandrodacs commented 1 year ago

Hello,

Would it be possible to put in fullmoon a way to disable root listing (redbean default) without the need to create an index file?

e.g. When the listing is deactivated A blank or 404, default route to / is created if the user has not defined

pkulchenko commented 1 year ago

Are you saying that you may not have any routes for / and the listing is displayed by default? Do you have any other routes or is this some configuration without any routes?

I'd rather consider doing the opposite: the listing is disabled by default, but you can enable it with a specific route (as desired).

evandrodacs commented 1 year ago

Correct, listing is disabled by default and only activated if the user wants

pkulchenko commented 1 year ago

I don't get any listing by default from the following code:

local fm = require"fullmoon"
fm.run()

I get 404 when accessing root URL /; isn't that what you'd expect?

evandrodacs commented 1 year ago

Oh great! This what I expected. Thanks for support!