DEV Community

loading...

Mojolicious::Plugin::AutoRoute 0.23 is released - Catch up with Mojolicious 9.0

yukikimoto profile image Yuki Kimoto ・1 min read

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;
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

enjoy!

Discussion (0)

pic
Editor guide