I would recommend openresty. A library that allows you to script nginx using a lightweight,easy to learn language lua. You get all the advantages of nginx (unmatched speed and resource efficiency) along with the ability to "inject" lua code into it's event loop. Which should be a compelling enough reason for you to give it at least some serious thought.
As far as organization of code is concerned openresty does not impose any restrictions on you. But since it is just lua you can bundle you code into modules. And then you can use those modules using "require" much like in node js (though it is slightly different)
Also there is lapis[1] and sailor[2] if you are looking for something more organized.
Comments
I would recommend openresty. A library that allows you to script nginx using a lightweight,easy to learn language lua. You get all the advantages of nginx (unmatched speed and resource efficiency) along with the ability to "inject" lua code into it's event loop. Which should be a compelling enough reason for you to give it at least some serious thought.
As far as organization of code is concerned openresty does not impose any restrictions on you. But since it is just lua you can bundle you code into modules. And then you can use those modules using "require" much like in node js (though it is slightly different)
Also there is lapis[1] and sailor[2] if you are looking for something more organized.
[1]https://github.com/leafo/lapis [2]https://github.com/Etiene/sailor