]> iEval git - plack-app-gruntmaster.git/blame_incremental - lib/Gruntmaster/Page/JS.pm
Return 404 when the requested theme is not found
[plack-app-gruntmaster.git] / lib / Gruntmaster / Page / JS.pm
... / ...
CommitLineData
1package Gruntmaster::Page::JS;
2
3use 5.014000;
4use strict;
5use warnings;
6use Gruntmaster::Page::Base;
7our @ISA = qw/Gruntmaster::Page::Base/;
8our $VERSION = '0.001';
9
10use File::Slurp qw/read_file/;
11use JavaScript::Minifier::XS qw/minify/;
12
13sub generate{
14 my ($self, $format, $logger) = @_;
15 debug $logger => "";
16 my $js;
17 $js .= read_file $_ for <js/*.js>;
18 [200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'public, max-age=604800'], [$js] ]
19}
20
21sub variants{ [[js => 1, 'application/javascript', undef, undef, undef, undef]] }
22
231
This page took 0.020244 seconds and 4 git commands to generate.