forked from mojolicious/mojo
-
Notifications
You must be signed in to change notification settings - Fork 0
Mojolicious and Plack Middleware
Htbaa edited this page Feb 10, 2011
·
3 revisions
I run my Mojolicious app like this:
plackup -p 3000 -R templates script/my_mojolicious_app
I wanted to enable some Plack middleware modules, so I edited script/my_mojolicious_app
, and made the following changes:
-
use Plack::Builder;
-
Replace the call to
Mojolicious::Command->start
at the end of the file with the following:builder { enable "Deflater"; # This is just an example (Mojolicious knows how to serve static files). enable "Static", path => sub { s!^/static/!! }, root => "public/"; Mojolicious::Commands->start; };