Skip to content

Instantly share code, notes, and snippets.

@espizo

espizo/foo.pm Secret

Created June 23, 2015 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save espizo/362d7f3d5bbc30c49350 to your computer and use it in GitHub Desktop.
Save espizo/362d7f3d5bbc30c49350 to your computer and use it in GitHub Desktop.
after_build_tx on request
#!/usr/bin/env perl
use Mojolicious::Lite;
app->hook( after_build_tx => sub {
my $tx = shift;
$tx->on( request => sub { warn 'request!!!' } );
});
get '/' => { text => 'okok' };
app->start;
@espizo
Copy link
Author

espizo commented Jun 23, 2015

The request event fires when I'm running:
./foo.pm daemon

But not when running:
plackup foo.pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment