On Mon, Feb 19, 2018 at 1:31 PM, Илья Рассадин <[email protected]> wrote:
> Do you have any server dispatching requests before Mojolicious?
>
> Nginx or Apache maybe?
>
Agreed. Check out this example:
$ cat /tmp/hook
use Mojolicious::Lite;
# Use /etc as the public folder root (because everyone has an /etc)
unshift @{app->static->paths}, '/etc';
app->hook(before_dispatch => sub {
my $c = shift;
print "Hi\n";
});
app->start;
You can see the hook prints 'Hi' as expected, and retrieves the requested
file /issue (under /etc)
$ perl /tmp/hook get /issue
Hi
Ubuntu 16.04.3 LTS \n \l
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.