Skip to content

Instantly share code, notes, and snippets.

@eviltik
Created December 28, 2014 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eviltik/c55dcaf376867b51bb3d to your computer and use it in GitHub Desktop.
Save eviltik/c55dcaf376867b51bb3d to your computer and use it in GitHub Desktop.
mojolicious: 404 not found rather than "Here" displayed when using under for "/"
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;
@eviltik
Copy link
Author

eviltik commented Dec 28, 2014

you need an endpoint for both "normal" route and "under" route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment