/[Frey]/trunk/lib/Frey/Mojo.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Mojo.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 633 by dpavlin, Sun Nov 30 01:46:13 2008 UTC revision 790 by dpavlin, Wed Dec 10 14:22:59 2008 UTC
# Line 7  use base 'Mojo'; Line 7  use base 'Mojo';
7    
8  use MojoX::Dispatcher::Static;  use MojoX::Dispatcher::Static;
9    
10    use lib 'lib';
11  use Frey::Server;  use Frey::Server;
12    
13  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
# Line 36  sub handler { Line 37  sub handler {
37          my ($self, $tx) = @_;          my ($self, $tx) = @_;
38    
39          if ( $self->static->dispatch($tx) ) {          if ( $self->static->dispatch($tx) ) {
40                  warn "# static ",dump( $tx );  #               warn "# static ",dump( $tx );
41                  return $tx;                  return $tx;
42          }          }
43    
# Line 48  sub handler { Line 49  sub handler {
49          };          };
50    
51          my $url = $tx->req->url->to_string;          my $url = $tx->req->url->to_string;
52          my $params = $tx->req->params;          my $params = $tx->req->params->to_hash;
53    
54          warn "# url $url params ",dump($params);          warn "# url $url params ",dump($params);
55    
56          $server->request( $url, $params ); # fetch body          my $content_type = $server->request( $url, $params ); # fetch body
57    
58  =for developer  =for developer
59    
# Line 67  sub handler { Line 68  sub handler {
68  =cut  =cut
69    
70          $tx->res->code(200);          $tx->res->code(200);
71          $tx->res->headers->content_type('text/html');          $tx->res->headers->content_type( $content_type );
72          $tx->res->body( $body );          $tx->res->body( $body );
73    
74          warn dump( $tx->res->headers );          warn dump( $tx->res->headers );

Legend:
Removed from v.633  
changed lines
  Added in v.790

  ViewVC Help
Powered by ViewVC 1.1.26