NAME
plackup - Run PSGI application with Plack servers
SYNOPSIS
# read your app from app.psgi file
plackup
# can be passed with --app option (Or -a)
plackup --app hello.psgi
# Switch server implementation with --server (or -s)
plackup --server Coro --port 9090
DESCRIPTION
plackup is a command line utility to run PSGI application from the command line.
plackup automatically figures out the environment it is run in, and runs your application in that environment. FastCGI, CGI, AnyEvent and others can all be detected. See Plack::Loader for the authorative list.
plackup
assumes you have an app.psgi
script in your current directory, that would look like:
#!/usr/bin/perl
use MyApp;
my $app = MyApp->new;
my $handler = sub { $app->run_psgi(@_) };
The last statement of app.psgi
should be a code reference that is a PSGI application.
OPTIONS
- -a, --app
-
Use the
--app
option to locate a.psgi
script with a different name in a different path. (Actually the path doesn't need to end in.psgi
: it's just there for convention) - -s, --server
-
Select a specific implementation to run on using the
PLACK_SERVER
environment variable or use the-s
or--server
flag which will be prefered over the environment variable if present. - -I
-
Specify perl library include path, like
perl
's -I option. - -E, --env
-
Specify the environment option (default is
development
). If it's set todevelopment
, following middleware is enabled by default: CommonLogger, StackTrace.