Amon2::Plugin::Web::Maintenance - Simple maintenance announcement page plugin for Amon2.
package MyApp::Web; __PACKAGE__->load_plugins('Web::Maintenance');
Amon2::Plugin::Web::Maintenance is simple maintenance announcement page plugin for Amon2.
You can configure in config file. This plugin use $c->config->{MAINTENANCE}.
$c->config->{MAINTENANCE}
+{ 'MAINTENANCE' => +{ enable => 1, except => +{ addr => ['127.0.0.1'], path => ['/info'] } }, };
If 'enable' is 1, your application response maintenance announcement page always.
You can except some request by using 'expect' value. 'addr' and 'path' express exceptional conditions like Plack::Builder::Conditionals.
You can customize the maintenance page. You can define the special named method 'res_maintenance'.
package MyApp::Web; sub res_maintenance { my ($c) = @_; return $c->create_response( 503, [ 'Content-Type' => 'text/plain', 'Content-Length' => 29, ], ['Service down for maintenance.'] ); }
Copyright (C) zoncoen.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
zoncoen <zoncoen@gmail.com>
To install Amon2::Plugin::Web::Maintenance, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amon2::Plugin::Web::Maintenance
CPAN shell
perl -MCPAN -e shell install Amon2::Plugin::Web::Maintenance
For more information on module installation, please visit the detailed CPAN module installation guide.