Skip to content

Instantly share code, notes, and snippets.

@SysPete
Created May 29, 2015 16:36
Show Gist options
  • Save SysPete/5f26392f4c8d8f1615c3 to your computer and use it in GitHub Desktop.
Save SysPete/5f26392f4c8d8f1615c3 to your computer and use it in GitHub Desktop.
app.psgi for dev work
#!/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