-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Lua Handler File #95
Labels
feature request
Enhancement or feature request
Comments
I think this is an excellent idea! I also like the file-based approach, and this seems to be a good compromise. 👍 |
giuliolunati
added a commit
to giuliolunati/algernon
that referenced
this issue
Mar 17, 2023
handle.lua files work as index.lua, but "cover" also subtree until "shadowed" by another handle.lua
giuliolunati
added a commit
to giuliolunati/algernon
that referenced
this issue
Mar 22, 2023
handler.lua files work as index.lua, but "cover" also the subtree until "shadowed" by an index.* file, or by another handler.lua
xyproto
pushed a commit
that referenced
this issue
Apr 20, 2023
Wow, this was done in #130 that is awesome! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just ran into a scenario where I want a Lua handler, but I don't want to put it in the server conf.
For example, I have an app that lives at
/crud/
and I want/crud/email/
to be a REST endpoint. It needs to respond to/crud/email/5
and so on. This is not currently feasible with the file-based approach, but I much prefer files because I can have multiple distinct webapps that don't rely upon the server config.I'm wondering if it would be feasible to have something like
handler.lua
as a supported way of responding to requests. If the directory contains ahandler.lua
, all requests prefixed by the path to that directory will execute that Lua script to respond to the request. Essentially the same asindex.lua
but for/*
instead of just/
.To restate, if you have
/a/b/handler.lua
then the requests/a/b/banana
and/a/b/apple/3
would be handled by executing/a/b/handler.lua
. Perhaps if you also have/a/b/c/handler.lua
then/a/b/c/joe
would execute that file instead of the more general/a/b/handler.lua
.Thought?
The text was updated successfully, but these errors were encountered: