In a similar vein, I knocked out a (quick and dirty) route-based [*]
framework prototype last year. If you're interested, see
http://0branch.com/project/lundu/lundu-0.0.1.tgz
The tarball includes a simple site as proof of concept. Here's an excerpt,
---8<---
get["/f"] = function()
return template("form.tmpl.html", {
title = "Form"
})
end
post["/p"] = function(posted)
return template("form_reply.tmpl.html", {
query = posted.query,
title = "Reply"
})
end
---8<---
To test it out, just run "lua t1.lua" -- you'll need xavante installed.
The templating engine is trivial at present, though I envisage (as with
Dancer) the ability to drop in a third party implementation.
Any feedback is welcome!
Best,
Marc
[*] See http://perldancer.org/ and http://www.sinatrarb.com/ for more info.