Genie.jl, global session variables

I need to write a very easy web application, in which I need to use Julia’s function. So I try to use Genie. To be honest, I don’t find good documentation, even the official doc isn’t full.

I wrote the simplest example. I need to understand how to work session variables.

using Genie, Genie.Router, Genie.Requests, Genie.Renderer.Html
function main()
route("/test") do
i = i+1
“test $i”

Would you suggest, how to create global variables for the session? Right now I have global variable for the whole site.

Thank you

P.S. Maybe you can suggest other libraries. Everything that I need, just to work with Get and Post request.

If you want to try other libraries, then maybe something of this would be useful:

Also you can take a look at DiffEqOnlineServer.

I would add to list my new lightweight web framework: dance.jl.

As per docs:

using Dance.Router

i = 0

function test() :: String
   global i
   i = i+1
   return ""

route("/", test; endpoint=HTML, method=GET)

Once you end session, i will be 0 again