25 lines
519 B
Perl
25 lines
519 B
Perl
package unix_dog;
|
|
use Mojo::Base 'Mojolicious', -signatures;
|
|
|
|
# This method will run once at server start
|
|
sub startup ($self) {
|
|
|
|
# Load configuration from config file
|
|
my $config = $self->plugin('NotYAMLConfig');
|
|
|
|
# Configure the application
|
|
$self->secrets($config->{secrets});
|
|
|
|
$self->defaults(title => 'UNIX.dog');
|
|
|
|
# Router
|
|
my $r = $self->routes;
|
|
|
|
# Normal route to controller
|
|
$r->get('/')->to('Main#index');
|
|
$r->get('/index.xhtml')->to('Main#index');
|
|
$r->get('/rules')->to('Main#rules');
|
|
}
|
|
|
|
1;
|