The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Plack::Builder::Conditionals - Plack::Builder extension

SYNOPSIS

use Plack::Builder;
use Plack::Builder::Conditionals;
# exports "match_if, addr, path, method, header, browser, any, all"

builder {
    enable match_if addr(['192.168.0.0/24','127.0.0.1']),
        "Plack::Middleware::ReverseProxy";

  enable match_if all( path(qr!^/private!), addr( '!', [qw!127.0.0.1 ::1!] ) ),
      "Plack::Middleware::Auth::Basic", authenticator => \&authen_cb;

  enable match_if sub { my $env = shift; $env->{HTTP_X_ENABLE_FRAMEWORK} },
      "Plack::Middleware::XFramework", framework => 'Test';

    $app;
};

use Plack::Builder::Conditionals -prefx => 'c';
# exports "c_match_if, c_addr, c_path, c_method, c_header, c_any, c_all"

DESCRIPTION

Plack::Builder::Conditionals is..

FUNCTIONS

EXPORT

use Plack::Builder::Conditionals -prefx => 'c';
# exports "c_match_if, c_addr, c_path, c_method, c_header, c_any, c_all"

you can add selected prefix to export functions

AUTHOR

Masahiro Nagano

SEE ALSO

Plack::Builder

LICENSE

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