PlackX-Framework

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

Every route action is called with two arguments: a request object and response
object. The response object is provided for convenience as the application may
return it or a different response object, (or even another request object as
described in the re-routing feature of PlackX::Framework::Request).

Filters are also called the same way, but they should only return a response
object if they wish to stop request processing. If a filter returns a false
value ($response->next is provided for semantic convenience), request processing
continues to the next matching filter or route.

Note that unlike some other frameworks, routes CANNOT cascade, but filters can.

For more information, see [PlackX::Framework::Router](https://metacpan.org/pod/PlackX%3A%3AFramework%3A%3ARouter).

### PlackX::Framework::Router::Engine

The PlackX::Framework::Router::Engine is a subclass of Router::Boom with some
extra convenience methods. Normally, you would not have to use this module
directly. It is used by PlackX::Framework::Router internally.

### PlackX::Framework::Config

lib/PlackX/Framework.pm  view on Meta::CPAN

Every route action is called with two arguments: a request object and response
object. The response object is provided for convenience as the application may
return it or a different response object, (or even another request object as
described in the re-routing feature of PlackX::Framework::Request).

Filters are also called the same way, but they should only return a response
object if they wish to stop request processing. If a filter returns a false
value ($response->next is provided for semantic convenience), request processing
continues to the next matching filter or route.

Note that unlike some other frameworks, routes CANNOT cascade, but filters can.

For more information, see L<PlackX::Framework::Router>.


=head3 PlackX::Framework::Router::Engine

The PlackX::Framework::Router::Engine is a subclass of Router::Boom with some
extra convenience methods. Normally, you would not have to use this module
directly. It is used by PlackX::Framework::Router internally.

lib/PlackX/Framework/Handler.pm  view on Meta::CPAN

  sub prebuild_app ($class, %options)  {
    # Freeze the router
    my $rt_engine = ($class->app_namespace . '::Router::Engine')->instance;
    $rt_engine->freeze;

    # Make app
    my $app = sub ($env) {
      psgi_response($class->handle_request($env, undef, $rt_engine))
    };

    # if app_base is specified, use URLMap, we don't need to cascade
    if (my $app_base = $class->app_base) {
      require Plack::App::URLMap;
      my $mapper = Plack::App::URLMap->new;
      $mapper->map($app_base => $app);
      #$mapper->map('/'       => $file_app) if $file_app;
      return $mapper->to_app;
    }

    return $app
  }



( run in 1.472 second using v1.01-cache-2.11-cpan-64ef6c95b5d )