Mojolicious::Plugin::AutoRoute is the module to create routes automatically. If you have most static-like template files, this module is useful.
Catch up with Mojolicious 9.0.
https://metacpan.org/pod/Mojolicious::Plugin::AutoRoute
# Mojolicious
$self->plugin('AutoRoute');
# Mojolicious::Lite
plugin 'AutoRoute';
# With option
plugin 'AutoRoute', route => $r;
Template files.
TEMPLATES ROUTES
templates/auto/index.html.ep # /
/foo.html.ep # /foo
/foo/bar.html.ep # /foo/bar
/foo/bar/baz.html.ep # /foo/bar/baz
enjoy!
Top comments (0)