[Dancer-users] Getting auto_reload to work

Deepak Gulati deepak.gulati at gmail.com
Fri Dec 17 04:52:36 CET 2010


Interesting! I like the way you turned necessity (that a webserver
must teardown and reload everything when running a CGI script) into a
virtue :).

That said, I was still running using the command line - perl
bin/app.pl - which uses the built-in dev server. Is there a way to
make auto_reload - or for that matter any other mechanism that
restarts my app upon change in a module.


On Fri, Dec 17, 2010 at 1:58 AM, Naveed Massjouni <naveedm9 at gmail.com> wrote:
> 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
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>


More information about the Dancer-users mailing list