Static files mountpoint

This commit is contained in:
Difrex(Denis Zheleztsov) 2014-08-04 13:35:42 +04:00
parent 51d8a79ce3
commit fbea04afed
2 changed files with 5 additions and 1 deletions

View File

@ -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;

2
run.sh
View File

@ -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