forked from tokuhirom/CPANasium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.psgi
25 lines (23 loc) · 785 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
25
use strict;
use utf8;
use File::Spec;
use File::Basename;
use lib File::Spec->catdir(dirname(__FILE__), 'extlib', 'lib', 'perl5');
use lib File::Spec->catdir(dirname(__FILE__), 'lib');
use Plack::Builder;
use Mikuregator::Web;
use Mikuregator;
use Plack::Session::Store::DBI;
use Plack::Session::State::Cookie;
use DBI;
my $db_config = Mikuregator->config->{DBI} || die "Missing configuration for DBI";
builder {
enable 'Plack::Middleware::Static',
path => qr{^(?:/static/)},
root => File::Spec->catdir(dirname(__FILE__));
enable 'Plack::Middleware::Static',
path => qr{^(?:/robots\.txt|/favicon\.ico)$},
root => File::Spec->catdir(dirname(__FILE__), 'static');
enable 'Plack::Middleware::ReverseProxy';
Mikuregator::Web->to_app();
};