--- trunk/lib/Frey/Server.pm 2008/09/09 23:15:46 184 +++ trunk/lib/Frey/Server.pm 2008/10/31 22:39:48 216 @@ -8,7 +8,7 @@ #use Continuity::REPL; use Data::Dump qw/dump/; -use Carp::REPL; +#use Carp::REPL; ## XXX it would be nice, but it breaks error reporting too much use Frey::ClassLoader; my @messages; # Global (shared) list of messages @@ -39,10 +39,10 @@ path_session => 1, cookie_session => 'sid', callback => \&main, - debug_level => 1, + debug_level => 2, staticp => sub { $_[0]->url =~ m/\.(jpg|jpeg|gif|png|css|ico|js|html?|xml|json|ya?ml)(\?.*)?$/ }, ); - $Module::Reload::Debug = 1; + $Module::Reload::Debug = 1; # auto if debug_level > 1 Frey::ClassLoader->new->load_all_classes(); $server->loop; } @@ -56,7 +56,7 @@ sub main { my ($req) = @_; - + my $path = $req->request->url->path; warn "REQUEST: $path ",dump( $req->params ),"\n"; @@ -75,20 +75,22 @@ $f = Frey::ObjectBrowser->new( fey_class => $1 ); } elsif ( $path =~ m!/od/([^/]+)(.*)! ) { $f = Frey::ObjectDesigner->new( fey_class => $1 ); - } elsif ( $path =~ m!/(markup|html)/([^/]+)(.*)! ) { + } elsif ( $path =~ m!/(markup|request)/([^/]+)(.*)! ) { $f = Frey::Run->new( class => $2 ); } else { - $f = Frey::ClassBrowser->new; + $f = Frey::Run->new( class => 'Frey::ClassBrowser' ); } - $f->html( $req ) if $f; + $f->request( $req ) if $f; }; + my $self = $req; + if ( $@ ) { warn $@; #$req->conn->send_error( 404 ); # FIXME this should probably be 500, but we can't ship page with it $req->print( qq{
$@
} );
-		Carp::REPL::repl;	# FIXME if $self->debug
+#		Carp::REPL::repl;
 
 	}
 
@@ -97,10 +99,6 @@
 		pushstream($req);
 	}
 
-	if ( $path =~ m/die/ ) {
-		Carp::REPL::repl;	# FIXME if $self->debug
-	}
-
 	# If they are sending us a message, we give them a thread for that too
 	if($path =~ /sendmessage/) {
 		send_message($req);