From fbea04afedd91e15b2bcc1440798dc7d620cf4e2 Mon Sep 17 00:00:00 2001 From: "Difrex(Denis Zheleztsov)" Date: Mon, 4 Aug 2014 13:35:42 +0400 Subject: [PATCH] Static files mountpoint --- iiplc.app | 4 ++++ run.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/iiplc.app b/iiplc.app index bc1c5cc..7ce06e5 100644 --- a/iiplc.app +++ b/iiplc.app @@ -19,6 +19,8 @@ use warnings; use Plack::Builder; use Plack::Request; use Plack::Response; +# Static files +use Plack::App::File; use II::Config; use II::Get; @@ -169,7 +171,9 @@ my $user = sub { return [ 200, [ 'Content-type' => 'text/html' ], [$mes_from], ]; }; +# Mountpoints builder { + mount "/static" => Plack::App::File->new(root => './s/')->to_app; mount '/' => $root; mount '/e' => $echo; mount '/s' => $thread; diff --git a/run.sh b/run.sh index 0a3677c..f22b9a8 100755 --- a/run.sh +++ b/run.sh @@ -1,7 +1,7 @@ #!/bin/bash # Debug server -plackup iiplc.app +screen -S ii plackup iiplc.app # Production # starman -l 127.0.0.1:5000 run.pl whatever