Created
December 28, 2014 10:55
-
-
Save eviltik/c55dcaf376867b51bb3d to your computer and use it in GitHub Desktop.
mojolicious: 404 not found rather than "Here" displayed when using under for "/"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp; | |
use Mojo::Base 'Mojolicious'; | |
sub startup { | |
my $self = shift; | |
$self->secrets(["gwhiddens3cr3ts"]); | |
$self->sessions->default_expiration(3600*24*7); | |
$self->sessions->cookie_name('SESSION'); | |
# Routes | |
my $r = $self->routes; | |
my $m = $r->under('/'=> sub { | |
my $c = shift; | |
$c->render(text => "Here."); | |
return undef; | |
}); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you need an endpoint for both "normal" route and "under" route