With Catalyst you register your actions and address them directly. For
example:
- sub hello : Global {
+ sub hello : Local {
my ( $self, $context ) = @_;
$context->response->body('Hello World!');
}
Now http://localhost:3000/hello prints "Hello World!".
Note that actions with the C< :Local > attribute are equivalent to
-using a C<:Path('/action_name') > attribute (note the leading slash).
-So our action could be equivalently:
+using a C<:Path('action_name') > attribute, so our action could be
+equivalently:
- sub hello : Path('/hello') {
+ sub hi : Path('hello') {
my ( $self, $context ) = @_;
$context->response->body('Hello World!');
}