Skip to content

Instantly share code, notes, and snippets.

@diegok
Last active November 15, 2018 22:19
Show Gist options
  • Save diegok/da761675af83cbc0df82656b0ade8247 to your computer and use it in GitHub Desktop.
Save diegok/da761675af83cbc0df82656b0ade8247 to your computer and use it in GitHub Desktop.
before_server_start is never trigger
use Mojolicious::Lite -signatures;
get '/' => sub($c) {
$c->render( text => $c->req->url->to_abs->port )
};
# Does not work
hook before_server_start => sub($server, $app) {
app->log->debug('before_server_start');
};
# Works
hook before_dispatch => sub($c) {
app->log->debug('before_dispatch');
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment