big kahuna
This commit is contained in:
@@ -5,16 +5,19 @@ use 5.036;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use FindBin;
|
||||
use Plack::Builder;
|
||||
use Plack::Session::Store::DBI;
|
||||
|
||||
use DBIx::Connector;
|
||||
use HTML::Composer;
|
||||
|
||||
use FindBin;
|
||||
use utf8::all;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use CW;
|
||||
use CW::Config;
|
||||
use CW::Router;
|
||||
use CW::Migration;
|
||||
|
||||
my $h = HTML::Composer->new();
|
||||
my $conf = CW::Config->new;
|
||||
@@ -26,16 +29,24 @@ my $conn = DBIx::Connector->new(
|
||||
);
|
||||
|
||||
my $router = CW::Router->new();
|
||||
|
||||
$router->get('/')->action('Index#index');
|
||||
|
||||
CW::Migration->migrate( $conn->dbh );
|
||||
|
||||
builder {
|
||||
sub {
|
||||
CW->new(
|
||||
dbh => $conn->dbh,
|
||||
environment => $conf->get('environment'),
|
||||
h => $h,
|
||||
router => $router
|
||||
)->app->(@_);
|
||||
}
|
||||
enable 'Session', store => Plack::Session::Store::DBI->new(
|
||||
get_dbh => sub {
|
||||
return $conn->dbh;
|
||||
}
|
||||
);
|
||||
enable 'Static', path => sub {
|
||||
/^\/robots\.txt/ or /^\/static\//;
|
||||
},
|
||||
root => "./public";
|
||||
CW->new(
|
||||
dbh => $conn->dbh,
|
||||
environment => $conf->get('environment'),
|
||||
h => $h,
|
||||
router => $router
|
||||
)->app;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user