This is a PSGI interface for FastCGI::NativeCall
Perl6
Switch branches/tags
Nothing to show
Latest commit aff6312 Jan 23, 2017 @jonathanstowe Add required "perl"
Permalink
Failed to load latest commit information.
lib/FastCGI/NativeCall initial import Aug 22, 2015
t initial import Aug 22, 2015
.gitignore Add .precomp Jan 23, 2017
LICENSE initial import Aug 22, 2015
META6.json Add required "perl" Jan 23, 2017
README.md initial import Aug 22, 2015

README.md

FastCGI::NativeCall::PSGI

This is a PSGI interface for FastCGI::NativeCall

Example

Basic usage:

use FastCGI::NativeCall;
use FastCGI::NativeCall::PSGI;

my $sock = FastCGI::NativeCall::OpenSocket("/var/www/run/example.sock", 5);
my $psgi = FastCGI::NativeCall::PSGI.new(FastCGI::NativeCall.new($sock));

sub dispatch-psgi($env) {
    return [ 200, { Content-Type => 'text/html' }, "Hello world" ];
}

$psgi.app(&dispatch-psgi);
$psgi.run;

Example using a PSGI framework:

use FastCGI::NativeCall;
use FastCGI::NativeCall::PSGI;
use Bailador;

get "/" => sub {
    "Hello world";
}

my $sock = FastCGI::NativeCall::OpenSocket("/var/www/run/example.sock", 5);

given FastCGI::NativeCall::PSGI.new(FastCGI::NativeCall.new($sock)) {
    .app(&Bailador::dispatch-psgi);
    .run;
}