dann > PlackX-RouteBuilder-0.03 > PlackX::RouteBuilder

Download:
PlackX-RouteBuilder-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

PlackX::RouteBuilder - Minimalistic routing sugar for your Plack

SYNOPSIS ^

  # app.psgi
  use PlackX::RouteBuilder;
  my $app = router {
    get '/api' => sub {
      my $req = shift;
      my $res = $req->new_response(200);
      $res->body('Hello world');
      $res;
    },
    post '/comment/{id}' => sub {
      my ($req, $args)  = @_;
      my $id = $args->{id};
      my $res = $req->new_response(200);
      $res;
    },
    any [ 'GET', 'POST' ] => '/any' => sub {
        my ( $req, $args ) = @_;
        my $res = $req->new_response(200);
        $res->body('any');
        $res;
    }, 
  };

DESCRIPTION ^

PlackX::RouteBuilder is Minimalistic routing sugar for your Plack

SOURCE AVAILABILITY ^

This source is in Github:

  http://github.com/dann/p5-plackx-routebuilder

CONTRIBUTORS ^

Many thanks to:

AUTHOR ^

dann <techmemo@gmail.com>

SEE ALSO Router::Simple, Plack ^

LICENSE ^

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

syntax highlighting: