-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.psgi
24 lines (18 loc) · 819 Bytes
/
app.psgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use Plack::Builder;
use Plack::App::WrapCGI;
builder {
# restart interchange
my $ic = `/home/vagrant/interchange/bin/interchange -r`;
print $ic ? $ic . "\n" : "ERROR: failed to restart interchange\n";
# Static files
enable 'Static',
path => qr{^/(images|js|css|interchange-5)/},
root => '/vagrant/html/';
enable 'Static',
path => qr{^/(sqlite|pgsql|mysql)/(images|js|css|interchange-5)/},
root => '/vagrant/html/';
# Mount paths
mount '/sqlite' => Plack::App::WrapCGI->new( script => '/home/vagrant/bin/sqlite', execute => 1 )->to_app;
mount '/pgsql' => Plack::App::WrapCGI->new( script => '/home/vagrant/bin/pgsql', execute => 1 )->to_app;
mount '/mysql' => Plack::App::WrapCGI->new( script => '/home/vagrant/bin/mysql', execute => 1 )->to_app;
};