package myWebSite; use Mojo::Base 'Mojolicious'; # This method will run once at server start sub startup { my $self = shift; # Load configuration from hash returned by config file my $config = $self->plugin('Config'); # Configure the application $self->secrets($config->{secrets}); # Router my $r = $self->routes; # Normal route to controller $r->get('/')->to('CustomController#displayLogin'); $r->post('/login')->to('CustomController#validUserCheck'); $r->any('/logout')->to('CustomController#logout'); my $authorized = $r->under('/')->to('CustomController#alreadyLoggedIn'); } 1;