Last active
December 10, 2015 00:38
-
-
Save esobchenko/4352482 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use Mojolicious::Lite; | |
| hook before_dispatch => sub { | |
| my $self = shift; | |
| $self->app->log->debug("entering 1st before dispatch hook..."); | |
| $self->render( text => "stop", status => 300 ); | |
| }; | |
| hook before_dispatch => sub { | |
| my $self = shift; | |
| $self->app->log->debug("entering 2nd before dispatch hook..."); | |
| }; | |
| hook after_dispatch => sub { | |
| my $self = shift; | |
| $self->app->log->debug("entering 1st after dispatch hook..."); | |
| }; | |
| hook after_dispatch => sub { | |
| my $self = shift; | |
| $self->app->log->debug("entering 2nd after dispatch hook..."); | |
| }; | |
| get '/' => sub { | |
| my $self = shift; | |
| $self->render(text => "foobar", status => 200); | |
| }; | |
| app->start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment