1Dancer2::Core::Route(3)User Contributed Perl DocumentatioDnancer2::Core::Route(3)
2
3
4

NAME

6       Dancer2::Core::Route - Dancer2's route handler
7

VERSION

9       version 0.300004
10

ATTRIBUTES

12   method
13       The HTTP method of the route (lowercase). Required.
14
15   code
16       The code reference to execute when the route is ran. Required.
17
18   regexp
19       The regular expression that defines the path of the route.  Required.
20       Coerce from Dancer2's route patterns.
21
22   prefix
23       The prefix to prepend to the "regexp". Optional.
24
25   options
26       A HashRef of conditions on which the matching will depend. Optional.
27

METHODS

29   match
30       Try to match the route with a given Dancer2::Core::Request object.
31       Returns the hash of matching data if success (captures and values of
32       the route against the path of the request) or "undef" if not.
33
34           my $match = $route->match( $request );
35
36   execute
37       Runs the coderef of the route.
38

AUTHOR

40       Dancer Core Developers
41
43       This software is copyright (c) 2020 by Alexis Sukrieh.
44
45       This is free software; you can redistribute it and/or modify it under
46       the same terms as the Perl 5 programming language system itself.
47
48
49
50perl v5.32.0                      2020-07-28           Dancer2::Core::Route(3)
Impressum