Reputation: 1617
I've installed the default setup for Mojolicious using mojo generate myapp MyApp
I can access the root of my application (i.e. index.html) but when I go to the '/welcome' route, it says 'The requested URL /welcome was not found on this server.'
I started the app using morbo myapp
which is in the /scripts directory and got this error
Could someone please help? I'm getting a lot of issues with routes not getting found when using Perl
Upvotes: 1
Views: 541
Reputation: 316
If the template doesn't exist/can't be found, you will get the error that no route exists. Check template configurations.
Upvotes: 0
Reputation: 35198
There is no /welcome
route in a default app generation using:
mojo generate app MyApp
To view the routes that are actually generated, you can just look at the source code.
However, you can also use the routes
command:
$ perl script\my_app routes
/perldoc/:module * perldocmodule
/ GET
Upvotes: 0
Reputation: 120
well, /welcome
route does not exist when start the default setup.
welcome.html.ep
template is uses by route /
# Normal route to controller
$r->get('/')->to('example#welcome');
and the reason you can access index.html
is because it is a static file under public folder. just like your static js or css files.
Upvotes: 1