22 lines
534 B
Perl
22 lines
534 B
Perl
package MyApp;
|
|
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});
|
|
|
|
# Router
|
|
my $r = $self->routes;
|
|
|
|
# Normal route to controller
|
|
$r->get('/')->to('example#welcome');
|
|
$r->get('/factoid_list')->to('example#factoid_display');
|
|
$r->get('/factoid_list/*server/enamespace/')->to('example#factoid_display');
|
|
}
|
|
|
|
1;
|