--- trunk/lib/Sack/Server.pm 2009/11/21 16:12:18 211 +++ trunk/lib/Sack/Server.pm 2009/11/21 16:34:12 212 @@ -94,8 +94,34 @@ Sack::Server::HTTP::request( $client, sub { warn "XXX callback ",dump( @_ ); my ( $send, $method, $param ) = @_; - print $send "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\n" - , dump( $info ) + + if ( $method =~ m{views} ) { + warn "$method ", -s $method, " bytes"; + my $code = read_file $method; + Sack::Merge->clean; + to_all { view => $code, path => $method }; + print $send "HTTP/1.0 302 $method\r\nLocation: /\r\n\r\n"; + return; + } elsif ( $method =~ m{^/tmp/sack} ) { + @shard_paths = glob "$method/*"; + warn "loading shard $method from ", dump( @shard_paths ); + to_all { load => $method }; + print $send "HTTP/1.0 302 $method\r\nLocation: /\r\n\r\n"; + return; + } + + print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"; + + print $send qq|

Views

| + ; + + print $send '

Info

' . dump( $info ) . '
'; + + print $send qq|

Data

| ; } ); } else {