Mojolicious::Plugin::Status - Mojolicious server status
# 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 ($c) { 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});
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 and should therefore only be used for debugging purposes.
Mojolicious::Plugin::Status supports the following options.
# Mojolicious::Lite plugin Status => {return_to => 'some_route'};
Name of route or path to return to when leaving the server status ui, defaults to /.
/
# 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.
/mojo-status
# Mojolicious::Lite plugin Status => {size => 1234};
Size of anonymous mapped memory to use for storing statistics, defaults to 52428800 (50 MiB).
52428800
# Mojolicious::Lite plugin Status => {slowest => 5};
Number of slowest requests to track, defaults to 10.
10
Mojolicious::Plugin::Status inherits all methods from Mojolicious::Plugin and implements the following new ones.
my $route = $plugin->register(Mojolicious->new);
Register renderer and helper in Mojolicious application.
The Mojolicious::Plugin::Status distribution includes a few files with different licenses that have been bundled for internal use.
Copyright (C) 2018, Sebastian Riedel.
Licensed under the CC-SA License, Version 4.0 http://creativecommons.org/licenses/by-sa/4.0.
Copyright (C) 2011-2018 The Bootstrap Authors.
Licensed under the MIT License, http://creativecommons.org/licenses/MIT.
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.
Sebastian Riedel, sri@cpan.org.
sri@cpan.org
Copyright (C) 2018-2021, 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.
Mojolicious, Mojolicious::Guides, https://mojolicious.org.
To install Mojolicious::Plugin::Status, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Status
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Status
For more information on module installation, please visit the detailed CPAN module installation guide.