add static serving under /raw/
Matt S Trout [Fri, 15 Jun 2012 17:25:12 +0000 (17:25 +0000)]
br.pl

diff --git a/br.pl b/br.pl
index 887e0df..054a5ec 100644 (file)
--- a/br.pl
+++ b/br.pl
@@ -1,6 +1,7 @@
 package TB_Temp_Packname;
 
 use Web::Simple;
+use Module::Runtime qw(use_module);
 use Scalar::Util qw(blessed);
 use IO::All;
 use JSON;
@@ -19,6 +20,11 @@ sub _build_json {
 
 sub dispatch_request {
   my ($self) = @_;
+  sub (/raw/...) {
+    use_module('Plack::App::Directory')->new({
+      root => $self->root->name
+    });
+  },
   sub () {
     response_filter {
       ref($_[0][0]) eq 'HASH' ? $self->render_table($_[0][0]) : $_[0]