On Mon, Feb 19, 2018 at 1:31 PM, Илья Рассадин <elcaml...@gmail.com> 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";


You can see the hook prints 'Hi' as expected, and retrieves the requested
file /issue (under /etc)
$ perl /tmp/hook get /issue
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 mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to