Makamaka Hannyaharamitu > Acme-Plack-Middleware-Acme-Werewolf-0.02 > Plack::Middleware::Acme::Werewolf

Download:
Acme-Plack-Middleware-Acme-Werewolf-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Plack::Middleware::Acme::Werewolf - Plack middleware of Acme::Apache::Werewolf

SYNOPSIS ^

  my $app = sub { ... };
  builder {
      enable "Acme::Werewolf", moonlength => 4;
      $app;
  };

DESCRIPTION ^

Plack middleware implementation of Acme::Apache::Werewolf which keeps werewolves out of your web site during the full moon.

CONFIGURATION ^

moonlength

Required. The period considered as a full moon (in day).

If you set moonlength with 4, the moon age from 12 to 16 is full moon.

message

Optional. The forbidden message. Default is 'Forbidden'.

handler

Optional. The subroutine reference for resoneses takes the plack middleware itself, environment variable and moon age.

    handler => sub {
        my ( $middleware, $env, $moon_age ) = @_;
        return [ 403, ['Content-Type' => 'text/plain'], ['Werewolf!'] ];
    }

If set this option, message option is ignored.

SEE ALSO ^

Acme::Apache::Werewolf, Astro::MoonPhase

AUTHOR ^

Makamaka Hannyaharamitu, <makamaka[at]cpan.org>

The author of Acme::Apache::Werewolf is Rich Bowen.

COPYRIGHT AND LICENSE ^

Copyright 2013 by Makamaka Hannyaharamitu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: