Dancer2...utoPage(3)

πŸ’– Dancer2::Handler::AutoPage πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation section (you know, the good stuff), and it's literally all about Dancer2::Handler::AutoPage β€” the class that handles the whole AutoPage situation. it's giving "automatic pages, no route-writing required" energy and honestly? obsessed. πŸ¦‹


✨ VERSION ✨

this is version 2.2.1, periodt. πŸ’…


🌸 DESCRIPTION 🌸

so AutoPage is a Handler β€” and heads up, it's turned off by default πŸ™ˆ β€” and its whole job is serving up pages that match a template that already exists. like, if a view exists whose name matches the requested path, Dancer2 will process that request using the Autopage handler. no cap.

to turn it on, add this to your config file:

auto_page: 1

and that's it!! this lets you serve simple pages sooooo easily, without having to write a route definition for every single one of them. the way that saves you so much boilerplate πŸ˜­πŸ‘‘

but lowkey important: if there's no view with the requested name, the route passes β€” which lets other matching routes get dispatched. so it's not a black hole, it just politely steps aside. 🫢


πŸŽ€ METHODS πŸŽ€

πŸ’« register

creates the routes. simple as that.

πŸ’« code

a code reference that processes the route request. it does the doing. ✨

πŸ’« methods

the methods that should be served for autopages.

Default: head, get.

πŸ’« regexp

the regexp (path) we want to match.

Default: /:page.


πŸ‘‘ AUTHOR πŸ‘‘

Dancer Core Developers β€” iconic behavior, fr fr.


this software is copyright (c) 2026 by Alexis Sukrieh.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, and legally speaking, free as a butterfly. πŸ¦‹


and that's the whole page bestie, we ate and left no crumbs πŸ’…βœ¨

later babes β€” this was Dancer2::Handler::AutoPage under perl v5.42.3, dated 2026-09-20. mwah πŸŽ€πŸ’–

πŸ“¦ where this page comes from