Skip to content

Instantly share code, notes, and snippets.

@mackee
Created October 20, 2012 23:22
Show Gist options
  • Save mackee/3925178 to your computer and use it in GitHub Desktop.
Save mackee/3925178 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use utf8;
use 5.014;
{
package MyApp::Dispatcher;
sub name { return 'Hogehoge' }
}
package MyApp;
use Plack::Util;
my $dispatcher_name = __PACKAGE__.'::Dispatcher';
Plack::Util::load_class($dispatcher_name);
my $app = sub {
my $body = "Hello ".$dispatcher_name->name;
return [
200,
["Content-Type" => "text/plain", "Content-Length" => length($body)],
[$body]
];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment