blib/lib/Plack/Handler/Corona.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 4 | 6 | 66.6 |
branch | n/a | ||
condition | n/a | ||
subroutine | 2 | 2 | 100.0 |
pod | n/a | ||
total | 6 | 8 | 75.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Plack::Handler::Corona; | ||||||
2 | 1 | 1 | 5481 | use strict; | |||
1 | 11 | ||||||
1 | 98 | ||||||
3 | 1 | 1 | 674 | use Corona::Server; | |||
0 | |||||||
0 | |||||||
4 | |||||||
5 | sub new { | ||||||
6 | my $class = shift; | ||||||
7 | bless { @_ }, $class; | ||||||
8 | } | ||||||
9 | |||||||
10 | sub run { | ||||||
11 | my($self, $app) = @_; | ||||||
12 | |||||||
13 | my $server = Corona::Server->new( | ||||||
14 | host => $self->{host} || '*', | ||||||
15 | user => $self->{user} || $>, | ||||||
16 | group => $self->{group} || $), | ||||||
17 | log_level => 1, | ||||||
18 | ); | ||||||
19 | $server->{app} = $app; | ||||||
20 | $server->run(port => $self->{port}); | ||||||
21 | } | ||||||
22 | |||||||
23 | 1; | ||||||
24 | |||||||
25 | __END__ |