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