58 |
my ($req) = @_; |
my ($req) = @_; |
59 |
|
|
60 |
my $path = $req->request->url->path; |
my $path = $req->request->url->path; |
61 |
warn "REQUEST: $path ",dump( $req->params ),"\n"; |
#warn "REQUEST: $path ",dump( $req->params ); |
62 |
|
|
63 |
Module::Reload->check if $path =~ m!reload! || $req->param('reload'); |
Module::Reload->check if $path =~ m!reload! || $req->param('reload'); |
64 |
|
|
78 |
} elsif ( $path =~ m!/(markup|request)/([^/]+)(.*)! ) { |
} elsif ( $path =~ m!/(markup|request)/([^/]+)(.*)! ) { |
79 |
$f = Frey::Run->new( class => $2 ); |
$f = Frey::Run->new( class => $2 ); |
80 |
} else { |
} else { |
81 |
$f = Frey::ClassBrowser->new; |
$f = Frey::Run->new( class => 'Frey::ClassBrowser' ); |
82 |
} |
} |
83 |
$f->request( $req ) if $f; |
$f->request( $req ) if $f; |
84 |
|
|
88 |
|
|
89 |
if ( $@ ) { |
if ( $@ ) { |
90 |
warn $@; |
warn $@; |
91 |
#$req->conn->send_error( 404 ); # FIXME this should probably be 500, but we can't ship page with it |
$req->conn->send_error( 404 ); # FIXME this should probably be 500, but we can't ship page with it |
92 |
$req->print( qq{<pre class="error">$@<pre>} ); |
$req->print( qq{<pre class="error">$@<pre>} ); |
93 |
# Carp::REPL::repl; |
# Carp::REPL::repl; |
94 |
|
|