The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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)

-o, --host

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.

-p, --port

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.

-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 to development, following middleware is enabled by default: CommonLogger, StackTrace.

-r, --reload

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.

SEE ALSO

Plack::Loader