Debian Codegraph @

t/lib/poc2.pm

raw
1 package poc2;
2
3 use strict;
4 use warnings;
5
6 use Dancer2;
7 set logger => 'Capture';
8
9 BEGIN {
10 set plugins => {
11 Polite => {
12 smiley => '8-D',
13 },
14 };
15 }
16
17 use PoC::Plugin::Polite ':app';
18
19 hook 'smileys' => sub {
20 send_error "Not in sudoers file. This incident will be reported";
21 };
22
23 get '/' => sub {
24 add_smileys( 'make me a sandwich.' );
25 };
26
27 get '/sudo' => sub {
28 hooked_smileys( 'make me a sandwich.' );
29 };
30
31 1;
32