Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: e24dabb7e5
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (12 sloc) 0.455 kB
use v6;
use HTTP::Daemon;
class Web::Handler::HTTPDaemon {
method run(&app, :$host = 'localhost', :$port = 8888) {
my HTTP::Daemon $d .= new(LocalAddr => $host, LocalPort => $port);
while my $c = $d.accept and my HTTP::Request $r = $c.get_request {
my $qs = $r.url.path ~~ / '?' (.*) $/ ?? $0 !! '';
my %env = { "QUERY_STRING" => $qs };
$c.send_response([~] &app(%env)[2].list);
}
}
}
Jump to Line
Something went wrong with that request. Please try again.