NAME
Mojolicious::Plugin::Status - Mojolicious server status
SYNOPSIS
# Mojolicious
$self->plugin('Status');
# Mojolicious::Lite
plugin 'Status';
# Secure access to the server status ui with Basic authentication
my $under = $self->routes->under('/status' =>sub {
my $c = shift;
return 1 if $c->req->url->to_abs->userinfo eq 'Bender:rocks';
$c->res->headers->www_authenticate('Basic');
$c->render(text => 'Authentication required!', status => 401);
return undef;
});
$self->plugin('Status' => {route => $under});
DESCRIPTION
Mojolicious::Plugin::Status is a Mojolicious plugin providing a server status ui for Mojo::Server::Daemon and Mojo::Server::Prefork. Note that this module is EXPERIMENTAL because the IPC mechanism used can be unreliable and slow down the whole application significantly. Therefore it should currently only be used for debugging purposes.
OPTIONS
Mojolicious::Plugin::Status supports the following options.
return_to
# Mojolicious::Lite
plugin Status => {return_to => 'some_route'};
Name of route or path to return to when leaving the server status ui, defaults to /
.
route
# Mojolicious::Lite
plugin Status => {route => app->routes->any('/status')};
Mojolicious::Routes::Route object to attach the server status ui to, defaults to generating a new one with the prefix /mojo-status
.
shm_key
# Mojolicious::Lite
plugin Status => {shm_key => 1234};
Shared memory key to use with IPC::ShareLite, defaults to 1234
.
METHODS
Mojolicious::Plugin::Status inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
my $route = $plugin->register(Mojolicious->new);
Register renderer and helper in Mojolicious application.
BUNDLED FILES
The Mojolicious::Plugin::Status distribution includes a few files with different licenses that have been bundled for internal use.
Artwork
Copyright (C) 2018, Sebastian Riedel.
Licensed under the CC-SA License, Version 4.0 http://creativecommons.org/licenses/by-sa/4.0.
Bootstrap
Copyright (C) 2011-2018 The Bootstrap Authors.
Licensed under the MIT License, http://creativecommons.org/licenses/MIT.
Font Awesome
Copyright (C) Dave Gandy.
Licensed under the MIT License, http://creativecommons.org/licenses/MIT, and the SIL OFL 1.1, http://scripts.sil.org/OFL.
AUTHOR
Sebastian Riedel, sri@cpan.org
.
COPYRIGHT AND LICENSE
Copyright (C) 2018, Sebastian Riedel and others.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.