Skip to content

@yko /debug-demo.psgi

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
PSGI Hello World with Plack Debug middleware
#!/usr/bin/env perl
use strict;
use warnings;
use Plack::Builder;
my $body = join '', <DATA>;
my $app = sub {
my $self = shift;
# Do whatever you want, but return PSGI-compatible response
# see
[200, ['Content-Type' => 'text/html'], [ $body ]];
builder {
# Precious debug info. Right on your page!
enable 'Debug';
# Make Plack middleware render some static for you
enable "Static",
path => qr{\.(?:js|css|jpe?g|gif|ico|png|html?|swf|txt)$},
root => './htdocs';
# Let Plack care about length header
enable "ContentLength";
<!doctype html>
<title>Few words about Plack and PSGI</title>
<h1>Hello World!</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.