Last active
August 29, 2015 14:05
-
-
Save gmodecorp/7be54d39d35dbf9d4c15 to your computer and use it in GitHub Desktop.
Web Server初期化・起動処理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# セットアップ処理をしています。 | |
sub BUILD { | |
my $self = shift; | |
$self->setup_dispatcher(); | |
$self->setup_view(); | |
$self->setup_context(); | |
} | |
# PSGIの仕様にそって、関数の参照を返却しています。 | |
sub to_app { | |
my $self = shift; | |
my $app = sub { | |
my $env = shift; | |
local $Ze::GLOBAL = {}; | |
my $c = $self->prepare_context( $env ); | |
$c->dispatch(); | |
}; | |
return $app; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment