big kahuna
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
# This is the main class for compiled.world, it is instantiated every request
|
||||
# Routes, database connections, and other data around the request lifecycle are passed
|
||||
# as attributes, and should not be instantiated per request.
|
||||
|
||||
package CW;
|
||||
|
||||
use Moo;
|
||||
@@ -9,6 +9,7 @@ use Plack::Request;
|
||||
|
||||
use CW::Plack::Request;
|
||||
use CW::Plack::Response;
|
||||
use CW::Migration;
|
||||
|
||||
has h => (
|
||||
is => 'ro',
|
||||
@@ -46,7 +47,7 @@ sub app {
|
||||
my $route = $match->{route};
|
||||
my $pkg = $route->pkg;
|
||||
my $action = $route->action;
|
||||
$pkg->new->$action( $request, $response );
|
||||
$pkg->new( dbh => $self->dbh )->$action( $request, $response );
|
||||
}
|
||||
else {
|
||||
$response->status(404);
|
||||
|
||||
Reference in New Issue
Block a user