File: HelloWorld.pm

package info (click to toggle)
libmojolicious-perl 8.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,720 kB
  • sloc: perl: 12,099; makefile: 14
file content (50 lines) | stat: -rw-r--r-- 888 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package Mojo::HelloWorld;
use Mojo::Base 'Mojolicious';

sub startup {
  my $self = shift;
  $self->log->level('error')->path(undef);
  $self->routes->any(
    '/*whatever' => {whatever => '', text => 'Your Mojo is working!'});
}

1;

=encoding utf8

=head1 NAME

Mojo::HelloWorld - Hello World!

=head1 SYNOPSIS

  use Mojo::HelloWorld;

  my $hello = Mojo::HelloWorld->new;
  $hello->start;

=head1 DESCRIPTION

L<Mojo::HelloWorld> is the default L<Mojolicious> application, used mostly for
testing.

=head1 ATTRIBUTES

L<Mojo::HelloWorld> inherits all attributes from L<Mojolicious>.

=head1 METHODS

L<Mojo::HelloWorld> inherits all methods from L<Mojolicious> and implements the
following new ones.

=head2 startup

  $hello->startup;

Creates a catch-all route that renders a text message.

=head1 SEE ALSO

L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.

=cut