T
T
Toopie2018-08-27 22:47:01
Nginx
Toopie, 2018-08-27 22:47:01

What is the best way to organize the structure of Lua modules?

Hello.
I am writing a small project - an API for the site, the entire backend is written in Lua. And then the question came up - is it necessary to split the API methods into different .lua files? In the end, I will compile it into bytecode via LuaJIT, so I think, if the file is compiled + if it has lua_cache_code on in the config, then do I need to make 100500 files at all, or can I shove it into 1? PS Now, when calling different methods, index.lua connects modules from /modules/*method*.lua Will it somehow
affect the speed of the response from the fact that all the code will be in 1 file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ambrosian, 2018-08-27
@Toopie

It's all about convenience for you.
To write any complicated project in one file is to confuse yourself. IMHO.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question