I am using Mojilicious Lite.
#!/usr/bin/perl -T
use strict;
use Mojolicious::Lite;
get '/' => 'index';
# Run the Mojolicious script in CGI mode.
app->start;
#template
__DATA__
@@ index.html.ep
<!DOCTYPE html>
<html>
<head>
<title>My title</title>
</head>
<body>
pass 15
</body>
</html>
All is working fine but I have an intermittent issue,some times I get error page which says:
"Page not found... yet!
None of these routes could generate a response for your GET request for /, maybe you need to add a new one?"
This happen very rarely (1 out of 20 hit).
Can anyone please let me know what is the issue and how can I overcome of it?
Thanks in advance..
My Error Log is:
[Tue May 26 18:12:42 2015] [debug] GET "/".
[Tue May 26 18:12:42 2015] [debug] Routing to a callback.
[Tue May 26 18:12:42 2015] [debug] Template "index.html.ep" not found.
[Tue May 26 18:12:42 2015] [debug] Template "not_found.development.html.ep" not found.
[Tue May 26 18:12:42 2015] [debug] Template "not_found.html.ep" not found.
[Tue May 26 18:12:42 2015] [debug] Rendering inline template "3e3201ab0667c1fc7f39089209f0435c".
[Tue May 26 18:12:42 2015] [debug] Rendering inline template "b2d451b47e2053ce583cbfdf7bcc6006".
Finally I find that this is a bug with mojilicious light(while rendering inline templetes). bug report 1 bug report 2
I resolved my problem by using external templates
Example:
My application file:
#!/usr/bin/perl -T
use strict;
use Mojolicious::Lite;
get '/' => 'index';
# Run the Mojolicious script in CGI mode.
app->start;
and my template file with name index.html.ep
<!DOCTYPE html>
<html>
<head>
<title>My title</title>
</head>
<body>
pass 15
</body>
</html>
Note: We have to define this file in templates directory .