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