How to exec batch of commands on our Redis instance

On this repo you'll find a bunch of script I build for moltin written in Lua and Bash, useful to maintain our database and execute commands »

How moltin used OpenResty and Lua to improve API performance

Just to clarify, this won't be a detailed technical guide about how you can build your own authentication layer using OpenResty + Lua, rather it is a »

OpenResty + multipart/form-data MINE type

By default multipart/form-data can't be processed by OpenResty and we need to pre process each request to be able to obtain the sent data. At »

How to update a Redis value without affecting the remaining TTL

Very self explanatory title, this beauty it's a Lua script running inside Redis interpreter, it will basically grap the ttl from the passed key if exist »

How to use a class's constructor on Lua

We add the following bits of code to our class: setmetatable(MyClass, { __call = function (cls, ...) return end, }) function local self = setmetatable( »

Lua sugar syntax double dots :

Using the sugar syntax : on Lua will allow us to access to the self table instance and for consecuent all methods and variables inside that specific »

Return JSON responses when using OpenResty + Lua

Related posts I've written few related post that may be interesting have a look to first: Returning status code with OpenResty + Lua When ngx.exit using »

Returning status code with OpenResty + Lua

If we want to return specific status codes from our Lua code we should have the following in mind: ngx.say("hello") return ngx.exit(404) »

When ngx.exit using OpenResty precede it with return

It is recommended than when using ngx.exit precede it with return to reinforce the fact that request will end. Few notes from Yichun Zhang about »