perlquestion
hesco
[https://gist.github.com/hesco/84f60c9c7eb5e4e6725262cd854dda1e]
<p>I am seeing this log entry: "<c>[debug] Controller "Vote::Controller::User::Login::User::Login" does not exist</c>". However, it would find everything it needs, instead at this path: <c>Vote::Controller::User::Login</c>.</p>
<code>
[Sun Jan 7 17:42:43 2018] [debug] GET "/cgi-bin/index"
[Sun Jan 7 17:42:43 2018] [debug] Routing to a callback
[Sun Jan 7 17:42:43 2018] [debug] [CGI:index:23229] START /opt/local/vote/vagrant/cf_vote/scripts/index
[Sun Jan 7 17:42:45 2018] [debug] 200 OK (1.266254s, 0.790/s)
</code>
<p>That worked fine.</p>
<code>
[Sun Jan 7 17:42:50 2018] [debug] GET "/cgi-bin/login"
[Sun Jan 7 17:42:50 2018] [debug] Routing to application "Vote::Controller::User::Login"
[Sun Jan 7 17:42:50 2018] [debug] Controller "Vote::Controller::User::Login::User::Login" does not exist
</code>
<p>Expecting to seek, instead:<br>
<c>Vote::Controller::User::Login</c></p>
<code>
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "user/login/login_dispatch.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "auth/login_page.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "auth/login.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "auth/password_reminder.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "auth/password_reset.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "auth/get_a_login.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "layouts/default.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "layouts/header.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "auth/logout.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] Rendering template "layouts/footer.html.ep"
[Sun Jan 7 17:42:50 2018] [debug] 200 OK (0.084435s, 11.843/s)
</code>
<p>It found the intended templates, but unsupported by a useful controller,
I am getting white screen of death in the browser.</p>
<code>
package Vote;
use lib qw( lib local/lib/perl5 );
use Mojo::Base 'Mojolicious';
use CGI;
use Moose;
use MooseX::NonMoose;
# <snip other dependencies, several Moose-enabled attributes>
sub startup {
my $self = shift;
my $log_file = 'VoteApp.log';
# <snip>
$self->plugin('CGI', {
support_semicolon_in_query_string => 1,
route => '/cgi-bin/index',
script => '/opt/local/vote/vagrant/cf_vote/scripts/index',
errlog => $log_file,
});
# and several additional routes to legacy 2006 era cgi scripts
$r->any(['GET','POST'] => '/cgi-bin/login')->to(
controller => 'user-login',
action => 'login_dispatch',
);
$r->any(['GET','POST'] => '/cgi-bin/password-reminder')->to(
controller => 'user-login',
action => 'login_dispatch',
);
$self->plugin('CGI', {
support_semicolon_in_query_string => 1,
route => '/cgi-bin/admin',
script => '/opt/local/vote/vagrant/cf_vote/scripts/admin',
errlog => $log_file,
});
# <snip>
}
</code>
<p>My question being: what is it I am missing about routing, which is causing this bug?</p>
<p><small><i>2018-01-09 [Athanasius] added code tags to log entry and linkified link</small></p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-511760">
if( $lal && $lol ) { $life++; }<br>
if( $insurance->rationing() ) { $people->die(); }
</div></div>