Amon2-Lite

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - 'any' was broken at 0.06

0.06

    * e26e2d3 better coding style
    * 936a1e4 better static file handling
    * cbe3fca puts x-nantoka headers by default
    * b857d56 simplified code
    * 8e20caa added enable_session method
    * added enable_middleware method
    * Return 405 Method Not Allowed if it's not allowed(Old impl returns 404)
    * 52a9094 docs about session

0.05

    [SETUP FLAVOR]
    * c4b5db2 ignore .gitignore files
    * d6e0163 better html skelton
    * eac6045 setup bootstrap and jquery by default.

    [DOC ENHANCEMENTS]

lib/Amon2/Lite.pm  view on Meta::CPAN

                my $content = '405 Method Not Allowed';
                return $c->create_response(
                    405,
                    [
                        'Content-Type'   => 'text/plain; charset=utf-8',
                        'Content-Length' => length($content),
                    ],
                    [$content]
                );
            } else {
                return $c->res_404();
            }
        }
    };

    my $tmpl_dir = File::Spec->catdir(dirname((caller(0))[1]), 'tmpl');
    *{"${base_class}::create_view"} = sub {
        $base_class->template_options();
    };
    *{"${base_class}::template_options"} = sub {
        my ($class, %options) = @_;

t/400_lite/09_get_post.t  view on Meta::CPAN

subtest 'GET /get_only' => sub {
    my $res = res_from_psgi($app->(req_to_psgi(GET 'http://localhost/get_only')));
    is($res->code, 200);
};
subtest 'POST /get_only' => sub {
    my $res = res_from_psgi($app->(req_to_psgi(POST 'http://localhost/get_only')));
    is($res->code, 405);
};
subtest 'GET /not_found' => sub {
    my $res = res_from_psgi($app->(req_to_psgi(POST 'http://localhost/not_found')));
    is($res->code, 404);
};

done_testing;



( run in 2.969 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )