Skip to content

Instantly share code, notes, and snippets.

@katlogic
Created September 11, 2016 02:54
Show Gist options
  • Save katlogic/9dca6aa9196f0fe1f25a07bc5a50f070 to your computer and use it in GitHub Desktop.
Save katlogic/9dca6aa9196f0fe1f25a07bc5a50f070 to your computer and use it in GitHub Desktop.
mydata.lua:
return { n = 1 }
nginx.conf:
location /lua {
content_by_lua '
local d = require "mydata"
d.n = d.n + 1
ngx.say(d.n)
';
}
# curl http://lua.cz/lua
2
# curl http://lua.cz/lua
3
@MarkBlah
Copy link

(beer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment