« blib/lib/auto/share/dist/Amon2/flavor/Minimum/lib/__PATH__.pm
↑ Summary
blib/lib/auto/share/dist/Amon2/flavor/Minimum/script/server.pl »
| 1 | package <% $module %>::Web; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | use utf8; | ||
| 5 | use parent qw(<% $module %> Amon2::Web); | ||
| 6 | use File::Spec; | ||
| 7 | |||
| 8 | sub dispatch { | ||
| 9 | my ($c) = @_; | ||
| 10 | |||
| 11 | $c->render('index.tx'); | ||
| 12 | } | ||
| 13 | |||
| 14 | # setup view | ||
| 15 | use <% $module %>::Web::View; | ||
| 16 | { | ||
| 17 | my $view = <% $module %>::Web::View->make_instance(__PACKAGE__); | ||
| 18 | sub create_view { $view } | ||
| 19 | } | ||
| 20 | |||
| 21 | __PACKAGE__->add_trigger( | ||
| 22 | AFTER_DISPATCH => sub { | ||
| 23 | my ( $c, $res ) = @_; | ||
| 24 | # for your security | ||
| 25 | $res->header( 'X-Content-Type-Options' => 'nosniff' ); | ||
| 26 | $res->header( 'X-Frame-Options' => 'DENY' ); | ||
| 27 | }, | ||
| 28 | ); | ||
| 29 | |||
| 30 | 1; |