1 |
dpavlin |
83 |
package Webpacus; |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use warnings; |
5 |
|
|
|
6 |
|
|
# |
7 |
|
|
# Set flags and add plugins for the application |
8 |
|
|
# |
9 |
|
|
# -Debug: activates the debug mode for very useful log messages |
10 |
|
|
# Static::Simple: will serve static files from the applications root directory |
11 |
|
|
# |
12 |
dpavlin |
93 |
use Catalyst qw/-Debug |
13 |
|
|
Static::Simple |
14 |
|
|
Prototype |
15 |
|
|
Config::YAML |
16 |
dpavlin |
100 |
FillInForm |
17 |
dpavlin |
93 |
/; |
18 |
dpavlin |
97 |
# FormValidator |
19 |
dpavlin |
83 |
|
20 |
|
|
our $VERSION = '0.01'; |
21 |
|
|
|
22 |
|
|
# |
23 |
|
|
# Configure the application |
24 |
|
|
# |
25 |
dpavlin |
93 |
__PACKAGE__->config( |
26 |
|
|
name => 'Webpacus', |
27 |
|
|
config_file => 'config.yml', |
28 |
|
|
); |
29 |
dpavlin |
83 |
|
30 |
|
|
# |
31 |
|
|
# Start the application |
32 |
|
|
# |
33 |
|
|
__PACKAGE__->setup; |
34 |
|
|
|
35 |
|
|
=head1 NAME |
36 |
|
|
|
37 |
|
|
Webpacus - Catalyst based application |
38 |
|
|
|
39 |
|
|
=head1 SYNOPSIS |
40 |
|
|
|
41 |
|
|
script/webpacus_server.pl |
42 |
|
|
|
43 |
|
|
=head1 DESCRIPTION |
44 |
|
|
|
45 |
|
|
Catalyst based application. |
46 |
|
|
|
47 |
|
|
=head1 METHODS |
48 |
|
|
|
49 |
|
|
=over 4 |
50 |
|
|
|
51 |
|
|
=item default |
52 |
|
|
|
53 |
|
|
=cut |
54 |
|
|
|
55 |
|
|
sub default : Private { |
56 |
|
|
my ( $self, $c ) = @_; |
57 |
|
|
$c->stash->{template} = 'index.tt'; |
58 |
|
|
} |
59 |
|
|
|
60 |
|
|
=item end |
61 |
|
|
|
62 |
|
|
=cut |
63 |
|
|
|
64 |
|
|
sub end : Private { |
65 |
|
|
my ( $self, $c ) = @_; |
66 |
|
|
|
67 |
|
|
# Forward to View unless response body is already defined |
68 |
|
|
$c->forward('View::TT') unless $c->response->body; |
69 |
dpavlin |
97 |
|
70 |
dpavlin |
100 |
$c->fillform; # defaults to $c->req->parameters |
71 |
|
|
|
72 |
dpavlin |
98 |
# $c->log->debug( $c->response->body ); |
73 |
dpavlin |
97 |
|
74 |
dpavlin |
83 |
} |
75 |
|
|
|
76 |
|
|
=back |
77 |
|
|
|
78 |
|
|
=head1 AUTHOR |
79 |
|
|
|
80 |
|
|
Dobrica Pavlinusic,,, |
81 |
|
|
|
82 |
|
|
=head1 LICENSE |
83 |
|
|
|
84 |
|
|
This library is free software, you can redistribute it and/or modify |
85 |
|
|
it under the same terms as Perl itself. |
86 |
|
|
|
87 |
|
|
=cut |
88 |
|
|
|
89 |
|
|
1; |