Local Middlewares

Middlewares are pieces of code that modify the requests and/or petitions that enter brainslug. At his heart, a middleware is a Lua function with the signature function(req, next_middleware), where req is a Lua table representing the request and next_middleware is a function that will pass the flow on to the next middleware, and will return the response (another table) .