line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
8668
|
% my $a = shift; |
|
2
|
|
|
2
|
|
7
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
238
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
730
|
|
2
|
|
|
|
|
|
|
# Put the following code where convenienient |
3
|
|
|
|
|
|
|
# in your startup application method. |
4
|
|
|
|
|
|
|
# It may need slight modifications depending |
5
|
|
|
|
|
|
|
# on your specific naming conventions. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Helpers go after your already defined helpers. |
8
|
|
|
|
|
|
|
# Beware to not override some already defined helper. |
9
|
|
|
|
|
|
|
%= $a->{helpers}; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# If you use Slovo add the table names to your configuration file |
12
|
|
|
|
|
|
|
# and the above helpers will be automatically generated during startup |
13
|
|
|
|
|
|
|
# e.g. |
14
|
|
|
|
|
|
|
{MojoDBx =>{ |
15
|
|
|
|
|
|
|
#... |
16
|
|
|
|
|
|
|
tables => [qw(<%= join(' ',@{$a->{tables}})%>)], |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
# Routes go after your already defined routes |
20
|
|
|
|
|
|
|
# See below if you are using Mojolicious::Plugin::RoutesConfig. |
21
|
|
|
|
|
|
|
% for my $r (@{$a->{routes}}) { |
22
|
|
|
|
|
|
|
% for my $via (@{$r->{via}}) { |
23
|
|
|
|
|
|
|
$r-><%= lc $via %>('<%= $r->{route} |
24
|
|
|
|
|
|
|
%>')->to('<%= $r->{to} %>')->name('<%= $r->{name} %>'); |
25
|
|
|
|
|
|
|
% } |
26
|
|
|
|
|
|
|
% } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# If you use Mojolicious::Plugin::RoutesConfig. |
29
|
|
|
|
|
|
|
[ |
30
|
|
|
|
|
|
|
% for my $r (@{$a->{routes}}) { |
31
|
|
|
|
|
|
|
% for my $via (@{$r->{via}}) { |
32
|
|
|
|
|
|
|
{<%= lc $via %> => '<%= $r->{route}%>', to => '<%= $r->{to} %>', name =>'<%= $r->{name} %>'}, |
33
|
|
|
|
|
|
|
% } |
34
|
|
|
|
|
|
|
% } |
35
|
|
|
|
|
|
|
] |
36
|
|
|
|
|
|
|
# To use the OpenAPI functionality, you have to add the following code to |
37
|
|
|
|
|
|
|
# your 'start' method. |
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
$self->plugin("OpenAPI" => {url => $self->home->child("api/api.json")}); |
40
|
|
|
|
|
|
|
|