Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Moblo;
- use Mojo::Base 'Mojolicious';
- use Moblo::Model::Login;
- use Mojo::SQLite;
- # This method will run once at server start
- sub startup {
- my $self = shift;
- # Documentation browser under "/perldoc"
- $self->plugin('PODRenderer');
- my $sql = Mojo::SQLite->new('sqlite:obruman.db');
- $self->helper(sqlite => sub { state $sql = Mojo::SQLite->new->('obruman.db') });
- $self->helper(login => sub { state $login = Mojo::Model::Login->new(sqlite => "obruman.db") });
- # Router
- my $r = $self->routes;
- # Normal route to controller
- $r->get('/')->to('login#index');
- $r->get('/checkSessionStatus')->to('login#checkSession');
- }
- 1;
Add Comment
Please, Sign In to add comment