public
anonymous / gist:1102077
Created

banner for Corona

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
--- /usr/local/perl/lib/perl5/Plack/Handler/Corona.pm 2010-03-11 03:27:14.000000000 -0800
+++ lib/Plack/Handler/Corona.pm 2011-07-23 18:21:22.000000000 -0700
@@ -1,6 +1,21 @@
+package Plack::Handler::Corona::Server;
+use strict;
+use base 'Corona::Server';
+
+sub pre_loop_hook {
+ my $self = shift;
+ $self->SUPER::pre_loop_hook(@_);
+
+ my $s = $self->{server};
+ $s->{_server_ready}->({
+ host => $s->{host}[0],
+ port => $s->{port}[0],
+ server_software => 'Corona',
+ });
+}
+
package Plack::Handler::Corona;
use strict;
-use Corona::Server;
sub new {
my $class = shift;
@@ -10,11 +25,12 @@
sub run {
my($self, $app) = @_;
- my $server = Corona::Server->new(
+ my $server = Plack::Handler::Corona::Server->new(
host => $self->{host} || '*',
user => $self->{user} || $>,
group => $self->{group} || $),
log_level => 1,
+ _server_ready => $self->{server_ready} || sub {},
);
$server->{app} = $app;
$server->run(port => $self->{port});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.