Rahul Sharma (Editor)

PSGI

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

PSGI or Perl Web Server Gateway Interface is an interface between web servers and Perl-based web applications and frameworks that allows writing portable applications that can be run as standalone servers or using CGI, FastCGI, mod_perl, et al. It is inspired by the Web Server Gateway Interface for Python, Rack for Ruby and JSGI for JavaScript.

Contents

A PSGI application is a Perl subroutine that accepts arguments as a single hash reference and returns a reference to an array of three elements: an HTTP status code, a reference to an array of HTTP headers and a reference to an array of HTTP body lines (usually a generated HTML document) or a filehandle-like object.

Plack is a reference PSGI implementation.

Web frameworks with PSGI support:

  • Catalyst
  • CGI::Application
  • Continuity
  • Dancer
  • HTTP::Engine
  • Leyland
  • Mason
  • Maypole
  • McBain
  • Mojolicious
  • Piglet
  • Squatting
  • Tatsumaki
  • Example Application

    This is an example hello world PSGI application:

    Save this file as hello.psgi and run it from the command-line: plackup hello.psgi

    Web hosting with support for standard PSGI

  • dotcloud.com
  • niwacap.com
  • OpenShift
  • References

    PSGI Wikipedia