From: Matt S Trout Date: Fri, 15 Jun 2012 17:25:12 +0000 (+0000) Subject: add static serving under /raw/ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b2e0720da37090a37c18329e9a4030434bd218c;p=scpubgit%2FJSON-Tree-Viewer.git add static serving under /raw/ --- diff --git a/br.pl b/br.pl index 887e0df..054a5ec 100644 --- 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]