File: MyApp.pm

package info (click to toggle)
libmojolicious-perl 2.98%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,968 kB
  • sloc: perl: 10,178; sh: 48; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 525 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
package MyApp;
use Mojo::Base 'Mojolicious';

# "Well, at least here you'll be treated with dignity.
#  Now strip naked and get on the probulator."
sub startup {
  my $self = shift;
  my $r    = $self->routes;

  # Load plugin
  $self->plugin('Config');

  # GET /
  $r->get(
    '/' => sub {
      my $self = shift;
      $self->render(text => $self->config->{works});
    }
  );

  # GET /test
  $r->get(
    '/test' => sub {
      my $self = shift;
      $self->render(text => $self->config->{whatever});
    }
  );
}

1;