lapis
lapis copied to clipboard
Subapplications in Lua
Hi!
I'm writing a Lapis application without Moonscript, and wanted the benefits of subapplications in Lua. There are a few other issues on this topic, but they all suggest rather weak workarounds.
The app:match("/", require("actions.actionname"))
method and require("actions.actionname")(app)
method both make the app.lua file a bit smaller but they are not nearly as powerful as the @include
versions.
In particular, I'm looking for the pure Lua way to get:
- subapplication-specific before_filters
- name and path prefixes
I've seen app:include
around in talks and examples @leafo has given , but I haven't gotten the chance to make it work.
If this is possible, I'd be willing to make a PR on the docs if I knew how to do it. If it isn't, I guess I'll get to writing the plumbing to accomplish it myself.
Thanks in advance :)
the lua-only subapplication support is currently missing from the code base! I didn't get a change to finish it up and push it in. I would like to do it soon though
Thanks for letting me know! I'll make do until then. I appreciate the work you put into this framework, good luck.
I miss this feature, I'm using only lua too and just noted that there is no support for subapplications. Is there any workaround to make app:include() work?
I think this should be reopened.
I built my first lapis application using lua but now I have swapped to moonscript which I really enjoy. Its definitely worth giving a try. Generally I use vscode with moonscript plugin or vim for moonscript.
Opening this up again until subapplications are available in lua
Why the moonscript support include, but lua does not support?
I created a sample project that adds sub-application support for Lua projects. Maybe it will help someone who finds this topic: https://github.com/VaiN474/lapis-lua-subapps