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

NAME

Labyrinth::PSGI - PSGI handler for Labyrinth

DESCRIPTION

Allow Labyrinth to run under Plack. Use the PSGI protocol to interface with a Plack web server to process web requests.

SYNOPSIS

Update your settings file to include the following lines.

    query-parser=PSGI
    writer-render=PSGI

Then create a .psgi file for your application, containing the following:

    use Labyrinth::PSGI;

    my $app = sub {
        my $env = shift;
        my $lab = Labyrinth::PSGI->new( $env, '/var/www/<mywebsite>/cgi-bin/config/settings.ini' );
        return $lab->run();
    };

You may also need to add builder instructions. These should be added to your .psgi file, and may look something like:

    use Plack::Builder;

    builder {
        enable "Static", path => qr!^/images/!,     root => '../html';
        enable "Static", path => qr!^/(cs|j)s/!,    root => '../html';
        enable "Static", path => qr!^/favicon.ico!, root => '../html';
        enable "Static", path => qr!^/robots.txt!,  root => '../html';
        $app;
    };

The above lines allow static files to pass through and be retrieved from the file system, rather than through your application.

METHODS

new( $env [, $config ] )

The constructor. Must be passed the environment variable from the PSGI server. You may optionally pass the Labyrinth configuration file as well, or via the run() method.

run( [ $config ] )

SEE ALSO

CGI::PSGI, Labyrinth

AUTHOR

Barbie, <barbie@missbarbell.co.uk> for Miss Barbell Productions, http://www.missbarbell.co.uk/

COPYRIGHT & LICENSE

  Copyright (C) 2013-2014 Barbie for Miss Barbell Productions
  All Rights Reserved.

  This module is free software; you can redistribute it and/or
  modify it under the Artistic License 2.0.