Trisha Shetty (Editor)

Plack (software)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Original author(s)
  
Tatsuhiko Miyagawa

Written in
  
Perl

Development status
  
Active

Website
  
plackperl.org

Plack (software)

Developer(s)
  
Tatsuhiko Miyagawa, Tokuhiro Matsuno, Jesse Luehrs, Tomas Doran, Graham Knop and others.

License
  
Perl License (Artistic License v2 + GNU General Public License v1)

Plack is a Perl web application programming framework inspired by Rack for Ruby and WSGI for Python, and it is the project behind the PSGI specification used by other frameworks such as Catalyst and Dancer.

Contents

Plackup is a command line utility to run PSGI applications from the command line.

Supported backends

As of March 2010 Plack supports the following server backends:

  • CGI
  • SCGI
  • FastCGI
  • mod_perl under Apache 1.3 and 2.0
  • Standalone HTTP server included in Plack
  • HTTP::Server::Simple
  • Corona
  • Starman
  • Twiggy
  • AnyEvent::HTTPD
  • AnyEvent::ReverseHTTP
  • Examples

    Using the default standalone HTTP server:

    $ plackup app.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/

    Running as a FastCGI daemon listening on a Unix socket, ready to be used by any Web server with FastCGI support:

    $ plackup -s FCGI—listen /tmp/fcgi.sock app.psgi FastCGI: manager (pid 3336): initialized FastCGI: manager (pid 3336): server (pid 3337) started FastCGI: server (pid 3337): initialized

    A working Hello world application run as a one-liner:

    $ plackup -e 'sub { [200, ["Content-Type" => "text/plain"], ["Hello, world!"]] }' HTTP::Server::PSGI: Accepting connections at http://0:5000/

    The command above starts an HTTP server listening on port 5000 of every local interface (IP address) and returns this 200 OK response to every HTTP request:

    References

    Plack (software) Wikipedia