1 package SCSite::DevMode;
7 has _static_handler => (is => 'lazy');
9 sub _build__static_handler {
11 my $static_dir = $self->config->{static_dir};
12 Plack::App::File->new(root => $static_dir)->to_app;
15 around dispatch_request => sub {
16 my ($orig, $self) = (shift, shift);
17 no warnings::illegalproto;
19 sub (/static/...) { $self->_static_handler },
20 sub (/favicon + .ico) { $self->_static_handler },
26 my ($self, @args) = @_;
27 my $r = Plack::Runner->new(server => 'Starman', app => $self->to_psgi_app);
28 $r->parse_options(@args);
29 $r->set_options(argv => \@args);