lib/ojo/ServeDir/App.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 10 | 10 | 100.0 |
branch | n/a | ||
condition | 2 | 3 | 66.6 |
subroutine | 3 | 3 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 16 | 17 | 94.1 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package ojo::ServeDir::App; | ||||||
2 | |||||||
3 | 1 | 1 | 3360 | use Mojo::Base 'Mojolicious'; | |||
1 | 2 | ||||||
1 | 7 | ||||||
4 | 1 | 1 | 55761 | use Cwd; | |||
1 | 4 | ||||||
1 | 168 | ||||||
5 | |||||||
6 | sub startup { | ||||||
7 | 2 | 2 | 1 | 125009 | my $app = shift; | ||
8 | 2 | 66 | 26 | my $dir = $ENV{SERVE_DIRECTORY} // getcwd; | |||
9 | 2 | 10 | $app->static->paths([$dir]); | ||||
10 | 2 | 31 | $app->log->info("Serving directory '$dir'...")->level('error'); | ||||
11 | } | ||||||
12 | |||||||
13 | 1; | ||||||
14 | |||||||
15 | __END__ |