big kahuna

This commit is contained in:
2026-08-15 23:05:57 -06:00
parent 6fec70c7c8
commit 84893662ca
25 changed files with 3886 additions and 27 deletions

View File

@@ -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;
};