ckage Mojolicious::Plugin::Surveil;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON qw(decode_json encode_json);
our $VERSION = '0.03';
sub register {
my ($self, $app, $config) = @_;
$con
t($config->{path})->to(
cb => sub {
my $c = shift->inactivity_timeout(60);
$c->on(json => $config->{handler});
}
);
}
sub _default_message_handler {
my ($c, $e) = @_;
get) = delete @$e{qw(type target)};
$c->app->log->debug(qq(Event "$type" on "$target" @{[encode_json $e]}));
}
sub _hook_after_render {
my ($config, $c, $output, $format) = @_;
return if $forma