« 試用 Mac Bumptop | Home | 在 git 的 pre-commit hook 裡面檢查 console.log »

December 24, 2009

Dancer

Dancer is a minimal web-framework for Perl world, which is entirely inspired by Sinatra in the Ruby land.

It is really simple to start coding in Dancer:

use Dancer;

get "/" => sub {
    "Hello World"
};

get "/hello/:name" => sub {
    "Hello, " . params->{name}
};

Path-based dispatching rules are declared with get/post/put/delete keywords, mapping to a given action sub-routine, from which, whatever returned is the response of the request.

The recommended template system to work with Dancer is Template Toolkit, the state of the art. I supposed it should be able to switch among several template engines, but it is not done yet.

I tried to write a toy app with Sinatra + DataMapper a few weeks ago and it went great. This week I tried Dancer + KiokuDB, and that was a little bumpy road, honestly said. Hmm, it looks like there are plenty of room to improve in the Perl wonderland.

I appreciate people taking time doing the Dancer project. Such minimalistic web framework can blow people’s mind.

No TrackBacks

TrackBack URL: http://gugod.org/mt/mt-tb.cgi/273

2 Comments

Hey, it'd be interesting to know the issues you faced when connecting KiokuDB and Dancer, so that we can nail them down.

Great post!

Some time ago, I wrote a really simple wiki thing using KiokuDB + Dancer, more as a proof of concept/toy-thing though.

http://github.com/oz/tiny_wiki

Hope this helps. :)

Leave a comment