I am looking for a simple and simple example of how to use the “under” functionality in the application “Moholic”. All the examples that I find deal with "Mojolicious :: Lite" (which I do not use). For example, I listened to screencast here http://mojocasts.com/e3 , and I think I understand the concept as functionality. But I do not use "Mojolicious :: Lite", so it seems that I can not directly follow the example. I continue to fail, trying to adopt the Lite example for a non-Lite style. (Perhaps this is also due to the fact that I'm still new to the structure)
The corresponding code is as follows:
# Router my $r = $self->routes;
Therefore, all of these routes must be user / password protected. I tried to do something like this:
$r->under = sub { return 1 if ($auth) };
But this does not compile, and I just can’t find an example that matches this style of code ... Can someone give me the correct hint or link here? And please forgive me if this is somewhere in the documents ... they may be complete, but they lack clear examples for simple like-minded people like me :-P
perl mojolicious
Boris Däppen
source share