-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.psgi
41 lines (33 loc) · 826 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use strict;
use warnings;
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 Amon2::Lite;
our $VERSION = '0.01';
# put your configuration here
sub load_config {
my $c = shift;
my $mode = $c->mode_name || 'development';
+{
'DBI' => [
'dbi:SQLite:dbname=$mode.db',
'',
'',
],
}
}
get '/' => sub {
my $c = shift;
return $c->render('index.html');
};
# load plugins
__PACKAGE__->load_plugin('Web::CSRFDefender');
# __PACKAGE__->load_plugin('DBI');
# __PACKAGE__->load_plugin('Web::FillInFormLite');
# __PACKAGE__->load_plugin('Web::JSON');
__PACKAGE__->enable_session();
__PACKAGE__->to_app(handle_static => 1);
__DATA__