-
Notifications
You must be signed in to change notification settings - Fork 2
/
Config.pm
102 lines (90 loc) · 2.11 KB
/
Config.pm
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
=pod
=encoding utf8
Доброго всем
=head1 Mojolicious::Che
¡ ¡ ¡ ALL GLORY TO GLORIA ! ! !
=head1 NAME
Config.pm - Пример конфига для Mojolicious::Che приложения
=head1 DESCRIPTION
See raw this module content.
=cut
{
'Проект'=>'Тест-проект',
# mojo => {
# mode=>...,
# log_level => ...,
# secrets => ...,
# plugins=> ...,
# session => ...,
# hooks => ...,
# has => ...,
# },
mojo_mode=> 'development',
mojo_log=>{level => 'debug'},
# plugins
'плугины'=>[
#~ [charset => { charset => 'UTF-8' }, ],
#~ ['HeaderCondition'],
#~ ['ParamsArray'],
#~ [Minion => {Pg => 'postgresql://postgres@/test'}],
],
#mojo_session
'сессия'=> {cookie_name => 'ELK'},
#mojo_secret
'шифры' => ['true 123 my app',],
# hooks
'хуки'=>{
#~ before_dispatch => sub {1;},
},
# has
'хазы' => {
foo => sub {my $app = shift; return 'bar!';},
},
# dbh
'базы000'=>{# will be as has dbh!
'main' => {
# DBI->connect(dsn, user, passwd, $attrs)
connect => ["DBI:Pg:dbname=test;", "guest", undef, {
ShowErrorStatement => 1,
AutoCommit => 1,
RaiseError => 1,
PrintError => 1,
pg_enable_utf8 => 1,
#mysql_enable_utf8 => 1,
#mysql_auto_reconnect=>1,
}],
# will do on connect
do => ['set datestyle to "ISO, DMY";',],
# prepared sth will get $app->sth->{<dbh name>}{<sth name>}
sth => {
foo => <<SQL,
select *
from foo
where
bar = ?;
SQL
},
}
},
# sth
# prepared sth will get $app->sth->{<dbh name>}{<sth name>}
'запросы' => {
main => {
now => "select now();"
},
},
# ns | namespaces
'спейсы'=>[],
# routes
'маршруты' => [
[get=>'/', to=> {cb=>sub{shift->render(format=>'txt', text=>'Здорова!');},}],
],
#~ 'задачи'=> {#first enable plugin Minion
#~ jobs => {
#~ slow_log => sub {
#~ my ($job, $msg) = @_;
#~ sleep 5;
#~ $job->app->log->error(qq{slow_log "$msg"});
#~ },
#~ },
};