package Arepa::Web;

use strict;
use warnings;

use base 'Mojolicious';

sub startup {
    my $self = shift;

    $self->secret("b1Tx3z.duN'tKn0Wbout4r3p4");
    $self->plugin("more_tag_helpers");

    # Routes
    my $r = $self->routes;
    my $auth = $r->bridge->to('auth#login');

    # Default route
    $auth->route('/')->to('dashboard#index')->name('home');
    $auth->route('/:controller/:action/:id')->name('generic_id');
    $auth->route('/:controller/:action')->name('generic');
}

1;

package Arepa::Web;

use strict;
use warnings;

use base 'Mojolicious';

sub startup {
    my $self = shift;

    $self->secret("b1Tx3z.duN'tKn0Wbout4r3p4");
    $self->plugin("more_tag_helpers");

    # Routes
    my $r = $self->routes;
    my $auth = $r->bridge->to('auth#login');

    # Default route
    $auth->route('/')->to('dashboard#index')->name('home');
    $auth->route('/:controller/:action/:id')->name('generic_id');
    $auth->route('/:controller/:action')->name('generic');
    $auth->route('/:controller')->name('generic_wo_action');
}

1;

Add an explicit route for controller-only paths (for Mojolicious >= 1.0)
Add an explicit route for controller-only paths (for Mojolicious >= 1.0)

