[Dancer-users] Getting auto_reload to work

Naveed Massjouni naveedm9 at gmail.com
Thu Dec 16 21:28:52 CET 2010


On Thu, Dec 16, 2010 at 11:38 AM, Deepak Gulati <deepak.gulati at gmail.com> wrote:
> Hi Folks,
>
> I am trying to get my dancer app to restart/reload any time I change a
> module in my lib directory. I've set auto_reload to 1 in config.yml
> and have Module::Refresh and Clone modules installed but nothing seems
> to happen when I make a change to a module in the lib folder and I
> have to manually restart for my changes to take effect. I am on Perl
> 5.10.1 and Dancer 1.2002 running on Mac OS 10.6.5.
>
> What am I doing wrong?
>
> I realize that auto_reload isn't meant for production use, but it'd be
> nice to have my changes loaded automatically on my dev box.
>
> Thanks,
> Deepak
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users

The auto_reload option is being deprecated and will be removed in
future versions.  What I do to achieve auto reload is simple by
running my app via CGI.  This is very easy.  If you have created a
scaffolded app via the command dancer -a MyApp for example, then it
will create a dispatch.cgi script for you in the public folder.  To
run via CGI, you just need to tell your web server about it.  All it
takes is something like this:

  cd /var/www/cgi-bin
  ln -s /path/to/MyApp/public/dispatch.cgi myapp.cgi

The path to your system's cgi-bin folder may be different, but that is
the basic idea.  Then each time you hit
http://localhost/cgi-bin/myapp.cgi, it will reload all the modules.

- Naveed Massjouni


More information about the Dancer-users mailing list