Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6e6acebfcc
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (18 sloc) 0.578 kb
#!/usr/bin/env perl6
###############################################################################
#
# Test script using the recommended API.
#
###############################################################################
use SCGI;
my $scgi = SCGI.new( :port(8118) );
my $handler = sub (%env)
{
my $name = %env<QUERY_STRING> || 'World';
my $status = '200';
my @headers = 'Content-Type' => 'text/plain';
my @body = "Hello $name\n";
@headers.push: 'Content-Length' => @body.join.encode.bytes;
return [ $status, \@headers, \@body ];
}
$scgi.handle: $handler;
Jump to Line
Something went wrong with that request. Please try again.