line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ojo::ServeDir::App; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3548
|
use Mojo::Base 'Mojolicious'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
4
|
1
|
|
|
1
|
|
78911
|
use Mojo::File 'path'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
5
|
1
|
|
|
1
|
|
6
|
use Cwd; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
191
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub startup { |
8
|
2
|
|
|
2
|
1
|
69126
|
my $app = shift; |
9
|
2
|
|
66
|
|
|
29
|
my $dir = path($ENV{SERVE_DIRECTORY} // getcwd)->to_abs; |
10
|
2
|
|
|
|
|
89
|
$app->static->paths([$dir]); |
11
|
2
|
|
|
|
|
28
|
$app->routes->get('/')->to(text => 'No index', status => 404); |
12
|
2
|
|
|
|
|
738
|
$app->log->info("Serving directory '$dir'...")->level('error'); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
1; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
__END__ |