Files
compiled.world/bin/compiled.world.psgi
2026-08-11 23:10:22 -06:00

42 lines
739 B
Perl

#!/usr/bin/env perl
use 5.036;
use strict;
use warnings;
use FindBin;
use Plack::Builder;
use DBIx::Connector;
use HTML::Composer;
use lib "$FindBin::Bin/../lib";
use CW;
use CW::Config;
use CW::Router;
my $h = HTML::Composer->new();
my $conf = CW::Config->new;
my $db_conf = $conf->get('db');
my $conn = DBIx::Connector->new(
$db_conf->get('dsn'),
$db_conf->get('username'),
$db_conf->get('password')
);
my $router = CW::Router->new();
$router->get('/')->action('Index#index');
builder {
sub {
CW->new(
dbh => $conn->dbh,
environment => $conf->get('environment'),
h => $h,
router => $router
)->app->(@_);
}
};