<div dir="ltr"><div>Hi dancers, I manage to load Plack middlewares from <a href="http://app.pl">app.pl</a>, but not from the config.yml file.<br><br></div><div> *** In <b><a href="http://app.pl">app.pl</a></b> I have:<br>
<br>use Plack::Builder;<br>builder {<br> enable 'Debug', panels =><br> [qw<Memory Timer>];<br><br> HabitLab->dance;<br>};<br><br>which works.<br></div><div><br><br></div><div> *** Here is what i put in <b>config.yml</b> instead (and which doesn't work) :<br>
layout: "main"<br><br>plack_middlewares:<br> - <br> - Debug<br> - panels<br> -<br> - Memory<br></div><div> - Timer<br></div><div><br></div><div>I know that the config file is used, because my layout is used.<br>
</div><div>And I know that this YAML is valid, and produces the following structure (outputed with Data::Printer) :<br>\ {<br> plack_middlewares [<br> [0] [<br> [0] "Debug",<br> [1] "panels",<br>
[2] [<br> [0] "Memory",<br></div><div> [1] "Timer", <br></div><div> ]<br> ]<br> ]<br>}<br><br></div><div>What I don't understand, is why the middleware doesn't work in this case. <br>
<div><br></div>Any idea?</div><div><br><br>I've followed the examples from here and there:<br><a href="http://advent.perldancer.org/2011/16">http://advent.perldancer.org/2011/16</a><br><a href="http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod#Plack_middlewares">http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod#Plack_middlewares</a><br>
</div></div>