Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (65 sloc) 3.59 KB
Piglet - PSGI micro web framework toolkit
Piglet is a DIY toolkit for web application and web framework
developers. Piglet is a collection of modules, utilities and helpers to
make it easier than ever to create a new micro web framework, or add new
features to existing frameworks.
Piglet has helpers and modules to quickly create a PSGI application, a
quick DSL helper to write a micro web router and adapters for existing
web frameworks to use these features.
Piglet is built on top of the PSGI standard, which means it works well
with most of PSGI supported web servers and Plack.
Rack is sexy and WSGI is cool. So is PSGI.
Plack solves the problem of "how to deploy Perl web applications" by
making the PSGI interface standard.
Now most Perl web frameworks support PSGI and can run on any of the
existing web servers via CGI, FastCGI, mod_perl as well as directly on
shiny new Perl web servers such as Starman, Twiggy and Corona.
PSGI made web framework developers happy.
However, now application developers keep asking questions *What's the
best framework to use with Plack*? The answer has been always *well,
whatever you like the most*, but it doesn't seem to satisfy most people.
Turns out, these web application developers want to use Plack to make
sure their application runs on any PSGI compatible web severs (check),
to benefit from Plack::Middleware features with tools such as
Plack::App::URLMap or Plack::Builder (check) and quickly build a very
simple web application handlers using Plack::Request or alike.
In the end they pretty much inlined their web application in ".psgi"
file using Plack::Builder and Plack::Request, which feels a bit chunky.
Writing a new web application without the learning cost of web
application frameworks is tricky, since most frameworks are featureful,
to reduce the amount of things you need to care about in the future.
This contradicts with the need of starting with something simple without
learning *anything* but with the possiblity of gradually upgrading the
application from simple to complex.
Exsiting solutions to this dilemma include things called *micro web
frameworks* such as Mojolicious::Lite, Squatting and Dancer: they are
excellent frameworks you should take a look at. They all support PSGI so
you can use Plack middleware with them as well :)
However Mojolicious and Dancer are also featureful, which is obviously a
great thing later, but we wanted something as thin, or in other words,
as *dumb* as possible, to start writing a new application.
So, Piglet is basically a toolkit to write a framework-less application,
or your *own micro web framework* for an application with more raw-ish
access to Plack middleware components with simple OO API or fancy DSL
Because it's built on top of PSGI, it's easy to later migrate or upgrade
to more featureful *real web frameworks* such as Catalyst or Jifty.
Read more about the idea of framework-less WSGI web application on Ian
Bicking's blog post
<> which is an
inspiration for this project.
Tatsuhiko Miyagawa
Tokuhiro Matsuno
Piglet is inpired by Sinatra, Merb, routes, Ruby on Rails, WebOb, juno,
bottle, Dancer and Mojolicious.
Copyright 2010- Tatsuhiko Miyagawa
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.