add files
|
1 |
package Mojolicious::Command::psgi; |
2 |
use Mojo::Base 'Mojolicious::Command'; |
|
3 | ||
4 |
use Mojo::Server::PSGI; |
|
5 | ||
6 |
has description => "Start application with PSGI.\n"; |
|
7 |
has usage => "usage: $0 psgi\n"; |
|
8 | ||
9 |
sub run { Mojo::Server::PSGI->new(app => shift->app)->to_psgi_app } |
|
10 | ||
11 |
1; |
|
12 | ||
13 |
=encoding utf8 |
|
14 | ||
15 |
=head1 NAME |
|
16 | ||
17 |
Mojolicious::Command::psgi - PSGI command |
|
18 | ||
19 |
=head1 SYNOPSIS |
|
20 | ||
21 |
use Mojolicious::Command::psgi; |
|
22 | ||
23 |
my $psgi = Mojolicious::Command::psgi->new; |
|
24 |
my $app = $psgi->run; |
|
25 | ||
26 |
=head1 DESCRIPTION |
|
27 | ||
28 |
L<Mojolicious::Command::psgi> starts applications with L<Mojo::Server::PSGI> |
|
29 |
backend. |
|
30 | ||
31 |
This is a core command, that means it is always enabled and its code a good |
|
32 |
example for learning to build new commands, you're welcome to fork it. |
|
33 | ||
34 |
=head1 ATTRIBUTES |
|
35 | ||
36 |
L<Mojolicious::Command::psgi> inherits all attributes from |
|
37 |
L<Mojolicious::Command> and implements the following new ones. |
|
38 | ||
39 |
=head2 description |
|
40 | ||
41 |
my $description = $psgi->description; |
|
42 |
$psgi = $psgi->description('Foo!'); |
|
43 | ||
44 |
Short description of this command, used for the command list. |
|
45 | ||
46 |
=head2 usage |
|
47 | ||
48 |
my $usage = $psgi->usage; |
|
49 |
$psgi = $psgi->usage('Foo!'); |
|
50 | ||
51 |
Usage information for this command, used for the help screen. |
|
52 | ||
53 |
=head1 METHODS |
|
54 | ||
55 |
L<Mojolicious::Command::psgi> inherits all methods from |
|
56 |
L<Mojolicious::Command> and implements the following new ones. |
|
57 | ||
58 |
=head2 run |
|
59 | ||
60 |
my $app = $psgi->run; |
|
61 | ||
62 |
Run this command. |
|
63 | ||
64 |
=head1 SEE ALSO |
|
65 | ||
66 |
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>. |
|
67 | ||
68 |
=cut |