plackup - Run PSGI application with Plack servers
# 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
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:
plackup
app.psgi
#!/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.
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)
--app
.psgi
The interface a TCP based server daemon binds to. Defauts to undef, which lets most server backends bind the the any (*) interface. This opeion doesn't mean anything if the server is not TCP based.
The port number a TCP based server daemon listens on. Defaults to 5000. This option doesn't mean anything if the server is not TCP based.
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.
PLACK_SERVER
-s
--server
Specify perl library include path, like perl's -I option.
perl
Specify the environment option (default is development). If it's set to development, following middleware is enabled by default: CommonLogger, StackTrace.
development
Make plackup to watch updates from your development directory and restarts the server whenever a file is updated. You can specify the path to watch file updates separated by comma (,) and it default to the current directory.
,
plackup -r /path/to/project/lib,/path/to/project/templates
Other options are passed through to the backend server. See each Plack::Server backend documentations to see which options are available.
Plack::Loader
To install Plack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack
CPAN shell
perl -MCPAN -e shell install Plack
For more information on module installation, please visit the detailed CPAN module installation guide.