Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use common::sense;
- use lib qw(../lib lib);
- $ENV{MOJO_APP} ||= 'App';
- use Mojolicious::Commands; Mojolicious::Commands->start;
- package App;
- use common::sense;
- use base 'Mojolicious';
- sub startup {
- my $self = shift;
- my $r = $self->routes;
- my $auth = $r->bridge->to('auth#check');
- $auth->route('/about/')->to('pref#about');
- $auth->route('/gift/')->to('gift#index');
- my $album = $auth->bridge->to('album#allow');
- $album->route('/album/create/')->to('album#create');
- }
- package App::Auth;
- use base 'Mojolicious::Controller';
- sub check { 1 }
- package App::Album;
- use base 'Mojolicious::Controller';
- sub allow { 1 }
- sub create { shift->render_text(__PACKAGE__) }
- package App::Gift;
- use base 'Mojolicious::Controller';
- sub index { shift->render_text(__PACKAGE__) }
- 1;
Add Comment
Please, Sign In to add comment