Skip to content

Commit

Permalink
show how to customize applications in PSGI environments
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 30, 2014
1 parent beab983 commit 725c0de
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -257,7 +257,21 @@ application logic.

builder {
enable 'Deflater';
require './script/myapp';
require 'myapp.pl';
};

You can also customize your application with L<Mojo::Server::PSGI>.

#!/usr/bin/env plackup -s FCGI
use Plack::Builder;
use Mojo::Server::PSGI;

builder {
enable 'Deflater';
my $server = Mojo::Server::PSGI->new;
$server->load_app('./script/myapp');
$server->app->config(foo => 'bar');
$server->to_psgi_app;
};

But you could even use middleware right in your application.
Expand Down

0 comments on commit 725c0de

Please sign in to comment.