I need some kind of initialization in Luan for URL mapping. I decided to always load "site:/index.html" before serving any pages. This way this file can do any required initialization. For example, index.html.luan could contain:
This will also work in luanhost. Does this make sense?
I decided to always load "site:/index.html" before serving any pages.
If this happens only once (when the very first request arrives) then I think this is acceptable. The problem is that this is not intuitive at all. If people ever browse that code, they will NEVER look at the import and think "hmm, this is how they initialize the site".
I am just wondering if we should have an explict call or if luan should just look for the "init" file in the private/lib folder. If the file is not there, then luan could search for it in the site: folder. The point is that we could have some sample projects and people should have full access to all resources and the init file shouldn't be hidden. This may not be an issue if we can do the import in the site folder like this