]> iEval git - gruntmaster-page.git/blobdiff - lib/Plack/App/Gruntmaster.pm
Make CSS/JS links end with .css/.js
[gruntmaster-page.git] / lib / Plack / App / Gruntmaster.pm
index 534326864bfa8c58724bf65f9c88c93fc4a86f59..a0711013f99fec760e5b36f50cb8f77ce495da7e 100644 (file)
@@ -22,7 +22,7 @@ sub call {
                my @args;
                next unless @args = $r->path =~ m/^$re$/a;
                my $format = choose $obj->variants, $r->headers;
-               return $obj->generate($format, $env->{'psgix.logger'}, map { $_ // '' } @args);
+               return $obj->generate($format, $env, map { $_ // '' } @args);
        }
 
        if ($r->method eq 'GET' || $r->method eq 'HEAD') {
@@ -35,7 +35,7 @@ sub call {
                        my $content = read_file "a/$article.$lang";
                        my $title = read_file "a/$article.$lang.title";
                        my $html = Gruntmaster::Page::Base::header($lang, $title) . $content . Gruntmaster::Page::Base::footer($lang);
-                       return [200, ['Content-Type' => 'text/html', 'Content-Language' => $lang, 'Vary' => 'Accept-Language'], [$html] ]
+                       return [200, ['Content-Type' => 'text/html', 'Content-Language' => $lang, 'Vary' => 'Accept-Language', 'X-Forever' => 1, 'Cache-Control' => 'max-age=300'], [$html] ]
                }
        }
 
@@ -58,11 +58,11 @@ BEGIN{
        my $word = qr,(\w+),a;
        my $ct = qr,(?:\/ct/$word)?,a;
 
-       get qr,/css/$word, => 'CSS';
-       get qr,/js, => 'JS';
+       get qr,/css/$word\.css, => 'CSS';
+       get qr,/js\.js, => 'JS';
 
        get qr,/ct/, => 'Ct';
-       get qr,/ct/$word, => 'Ct::Entry';
+       get qr,/ct/$word/, => 'Ct::Entry';
        get qr,/us/, => 'Us';
        get qr,/us/$word, => 'Us::Entry';
 
@@ -70,9 +70,12 @@ BEGIN{
        get qr,$ct/log/st, => 'St';
        get qr,$ct/log/job/$word, => 'Log::Entry';
        get qr,$ct/log/src/$word\.$word, => 'Src';
-       get qr,$ct/submit, => 'Submit';
        get qr,$ct/pb/, => 'Pb';
        get qr,$ct/pb/$word, => 'Pb::Entry';
+       post qr,$ct/pb/$word/submit, => 'Submit';
+
+       post qr,/action/register, => 'Register';
+       post qr,/action/passwd, => 'Passwd';
 }
 
 1;
This page took 0.022015 seconds and 4 git commands to generate.