Mojolicious::Plugin::ServerType - A Mojolicious Plugin that provides a helper that identifies the server type
use Mojo::Base -strict; use Mojolicious::Lite; plugin 'ServerType'; get '/' => sub { my $c = shift; $c->render( json => {"serverType" => $c->app->server_type } ); }; app->start;
Mojolicious::Plugin::ServerType is a Mojolicious Plugin that provides a helper which can be used to identify the type of server that Mojolicious is running in (e.g. Mojo::Server::Daemon, Mojo::Server::Prefork)
Mojo::Server::Daemon
Mojo::Server::Prefork
server_type
Mojolicious::Plugin::ServerType adds the server_type helper which simply returns the Class of the server that it's running under. If not running under a server or the server doesn't support the before_server_start hook then undef will be returned.
before_server_start
undef
Copyright (C) Jason Cooper.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Jason Cooper <JLCOOPER@cpan.org>
To install Mojolicious::Plugin::ServerType, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::ServerType
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::ServerType
For more information on module installation, please visit the detailed CPAN module installation guide.