robin/maivi

a tiny cute lua web framework

git clone https://git.robinwobin.dev/robin/maivi

robinexamples: indextxt plugin8d7131b

main
202 B6 linesraw
1maivi.hook("handle", { path = "/" }, function(ctx)
2  local useragent = ctx.request.headers["User-Agent"]
3  if string.match(useragent, "^curl") then
4    return ctx:redirect("/index.txt", nil)
5  end
6end)