]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/JS.pm
Heeere's Plack/PSGI!
[gruntmaster-page.git] / lib / Gruntmaster / Page / JS.pm
CommitLineData
7dc32473
MG
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' => 'max-age=604800'], [minify $js] ]
19}
20
21sub variants{ [[js => 1, 'application/javascript', undef, undef, undef, undef]] }
22
231
This page took 0.021968 seconds and 4 git commands to generate.