-
-
14 Mar 2022 02:18:12 UTC
- Distribution: Dancer2
- Module version: 0.400000
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (1526 / 4 / 9)
- Kwalitee
Bus factor: 3- 84.77% Coverage
- License: perl_5
- Perl: v5.12.5
- Activity
24 month- Tools
- Download (393.07KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Dancer Core Developers
- Dependencies
- Attribute::Handlers
- CLI::Osprey
- Carp
- Clone
- Config::Any
- Digest::SHA
- Encode
- Exporter
- Exporter::Tiny
- File::Basename
- File::Copy
- File::Path
- File::Share
- File::Spec
- File::Temp
- File::Which
- HTTP::Date
- HTTP::Headers::Fast
- HTTP::Tiny
- Hash::Merge::Simple
- Hash::MultiValue
- Import::Into
- JSON::MaybeXS
- List::Util
- MIME::Base64
- Module::Runtime
- Moo
- Moo::Role
- POSIX
- Path::Tiny
- Plack
- Plack::Middleware::FixMissingBodyInRedirect
- Plack::Middleware::RemoveRedundantBody
- Ref::Util
- Role::Tiny
- Safe::Isa
- Sub::Quote
- Template
- Template::Tiny
- Test::Builder
- Test::More
- Type::Tiny
- Types::Standard
- URI::Escape
- YAML
- parent
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Dancer2::Core::Dispatcher - Class for dispatching request to the appropriate route handler
VERSION
version 0.400000
SYNOPSIS
use Dancer2::Core::Dispatcher; # Create an instance of dispatcher my $dispatcher = Dancer2::Core::Dispatcher->new( apps => [$app] ); # Dispatch a request my $resp = $dispatcher->dispatch($env)->to_psgi; # Capture internal error of a response (if any) after a dispatch $dispatcher->response_internal_error($app, $error); # Capture response not found for an application the after dispatch $dispatcher->response_not_found($env);
ATTRIBUTES
apps
The apps is an array reference to Dancer2::Core::App.
default_content_type
The default_content_type is a string which represents the context of the request. This attribute is read-only.
METHODS
dispatch
The
dispatch
method accepts the list of applications, hash reference for the env attribute of Dancer2::Core::Request and optionally the request object and an env as input arguments.dispatch
returns a response object of Dancer2::Core::Response.Any before hook and matched route code is wrapped to allow DSL keywords such as forward and redirect to short-circuit remaining code, returning across multiple stack frames without having to throw an exception.
response_internal_error
The
response_internal_error
takes as input the list of applications and a variable error and returns an object of Dancer2::Core::Error.response_not_found
The
response_not_found
consumes as input the list of applications and an object of type Dancer2::Core::App and returns an object Dancer2::Core::Error.AUTHOR
Dancer Core Developers
COPYRIGHT AND LICENSE
This software is copyright (c) 2022 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Dancer2, copy and paste the appropriate command in to your terminal.
cpanm Dancer2
perl -MCPAN -e shell install Dancer2
For more information on module installation, please visit the detailed CPAN module installation guide.