« blib/lib/Bootylicious/ArticleArchiveYearly.pm
↑ Summary
blib/lib/Bootylicious/PageIteratorFinder.pm »
| 1 | package Bootylicious::Plugin::Admin; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use base 'Mojolicious::Plugin'; | ||
| 7 | |||
| 8 | require Carp; | ||
| 9 | |||
| 10 | sub register { | ||
| 11 | my ($self, $app, $conf) = @_; | ||
| 12 | |||
| 13 | $conf ||= {}; | ||
| 14 | |||
| 15 | Carp::croak qq/Password and username are required for this plugin to work/ | ||
| 16 | unless $conf->{username} && $conf->{password}; | ||
| 17 | |||
| 18 | $app->routes->route('/admin')->detour(namespace => 'Bootylicious::Admin', conf => $conf); | ||
| 19 | } | ||
| 20 | |||
| 21 | 1; |