lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



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.

Hi Marc

I think this is a great project. I've gone through all the code but I'll need a little more time to understand everything as I am not a professional programmer.

I wish I found a project like this years ago, the Djangos of the world are nothing but a big black box for newbies and unlike your project, of no tutorial value.

Thanks-Patrick