Created
May 29, 2015 16:36
-
-
Save SysPete/5f26392f4c8d8f1615c3 to your computer and use it in GitHub Desktop.
app.psgi for dev work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Plack::Builder; | |
use Plack::Middleware::Debug::DBIC::QueryLog; | |
use Plack::Middleware::DBIC::QueryLog; | |
use Dancer; | |
use Dancer::Plugin::DBIC; | |
use Dancer::Handler; | |
use lib 'lib'; | |
use DanceShop; | |
my $app = sub { | |
load_app "DanceShop"; | |
Dancer::App->set_running_app("DanceShop"); | |
my $env = shift; | |
my $schema = schema->clone; | |
my $querylog = | |
Plack::Middleware::DBIC::QueryLog->get_querylog_from_env($env); | |
$schema->storage->debug(1); | |
$schema->storage->debugobj($querylog); | |
Dancer::Handler->init_request_headers($env); | |
my $req = Dancer::Request->new( env => $env ); | |
Dancer->dance($req); | |
}; | |
builder { | |
enable 'Debug', | |
panels => [ | |
'Parameters', 'Dancer::Version', | |
'Dancer::Settings', 'Dancer::Logger', | |
'Dancer::TemplateVariables', 'DBIC::QueryLog', | |
'Timer',# 'Profiler::NYTProf', | |
]; | |
mount "/" => $app; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment