Question

I have got a Mojolicious::Lite app:

use Mojolicious::Lite;
use User;

get '/' => sub {
   my $self = shift;
   $self->render('index');
};

get '/login' => sub {
   my $self = shift;
   $self->redirect_to(User::getLoginLink);
};

I use Morbo in development. I don't need to restart Morbo if I change code in this 2 subs, but User::getLoginLink will be updated only with morbo's restart. Is it possible to make morbo watch for changes in modules? (for example, 'User' module)

Was it helpful?

Solution

You can use option -w of morbo server. By default morbo watch for changes only application script and catalogs lib and templates in current directory.

Example of usage from morbo help:

morbo -w /usr/local/lib -w public myapp.pl

OTHER TIPS

Run morbo under the perl debugger (perl -d /path/to/morbo /path/to/script) and diagnose where it is hanging.

You also might look at the built-in Morbo debugging. Enable the environment variables MOJO_DAEMON_DEBUG and MOJO_BASE_DEBUG for more info from Morbo/Hypnotoad. See the Mojolicious Wiki ENV list for more debugging options.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top