package PhotoAlbum;

use utf8;
use Mojo::Base 'Mojolicious';
use album;

# This method will run once at server start
sub startup {
    my $self = shift;
    $self->attr( album => sub { album->new() } );

    # Documentation browser under "/perldoc"
    $self->plugin('PODRenderer');

    # Router
    my $r = $self->routes;

    # Normal route to controller
    $r->get('/')->to('example#welcome');
    $r->get('/onepic')->to('example#onepic');
    $r->post('/upload')->to('example#upload');
    $r->post('/edit')->to('example#edit');
    $r->get('/next')->to('example#next');
    $r->get('/flick')->to('example#flick');

}

1;
