| Mojolicious documentation | Contained in the Mojolicious distribution. |
Mojolicious::Command::Psgi - PSGI Command
use Mojolicious::Command::Psgi; my $psgi = Mojolicious::Command::Psgi->new; my $app = $psgi->run;
Mojolicious::Command::Psgi is a command interface to Mojo::Server::PSGI.
Mojolicious::Command::Psgi inherits all attributes from Mojo::Command and implements the following new ones.
description my $description = $psgi->description;
$psgi = $psgi->description('Foo!');
Short description of this command, used for the command list.
usage my $usage = $psgi->usage;
$psgi = $psgi->usage('Foo!');
Usage information for this command, used for the help screen.
Mojolicious::Command::Psgi inherits all methods from Mojo::Command and implements the following new ones.
runmy $app = $psgi->run;
Run this command.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
| Mojolicious documentation | Contained in the Mojolicious distribution. |
package Mojolicious::Command::Psgi; use Mojo::Base 'Mojo::Command'; use Mojo::Server::PSGI; has description => <<'EOF'; Start application with PSGI. EOF has usage => <<"EOF"; usage: $0 psgi EOF # "In the end it was not guns or bombs that defeated the aliens, # but that humblest of all God's creatures... the Tyrannosaurus Rex." sub run { my $self = shift; my $psgi = Mojo::Server::PSGI->new; # Preload $psgi->app; # Return app callback sub { $psgi->run(@_) }; } 1; __END__