use constant NOT_FOUND => [404, ['Content-Type' => 'text/plain'], ['Not found']];
use constant FORBIDDEN => [401, ['Content-Type' => 'text/plain', 'WWW-Authenticate' => 'Basic realm="Gruntmaster 6000"'], ['Forbidden']];
+sub development() { ($ENV{PLACK_ENV} // 'development') eq 'development' }
+
my $env;
sub db { $env->{'gruntmaster.dbic'} }
my $css = read_file "css/themes/$theme.css";
$css .= read_file $_ for <css/*.css>;
my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'text/css');
- [200, \@headers, [CSS::Minifier::XS::minify $css]]
+ [200, \@headers, [development ? $css : CSS::Minifier::XS::minify $css]]
},
sub (/js.js) {
my $js;
$js .= read_file $_ for <js/*.js>;
my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'application/javascript');
- [200, \@headers, [JavaScript::Minifier::XS::minify $js]]
+ [200, \@headers, [development ? $js : JavaScript::Minifier::XS::minify $js]]
},
sub (/src/:job) {