<div dir="ltr">That's what I ended up doing, cheers =)<br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">--- Pierre Masci<br>I check email a couple times daily; to reach me sooner, you can send me a text message via this page: <a href="https://awayfind.com/mascip" target="_blank">https://awayfind.com/mascip</a><br>
</div></div>
<br><br><div class="gmail_quote">On 6 December 2013 13:27, sawyer x <span dir="ltr"><<a href="mailto:xsawyerx@gmail.com" target="_blank">xsawyerx@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div>Dancer2 has disabled adding Plack middlewares through the app. The proper way to do this is to use Plack::Builder.<br>There are a few examples, but it's pretty straight-forward.<br>
<br>
</div>use Plack::Builder;<br>use Plack::Middleware::Debug;<br>use MyApp;<br><br></div>builder {<br></div> enable 'Debug',<br></div> MyApp->start,<br><div><div>};<br><br><div><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><div><div class="h5">On Fri, Oct 18, 2013 at 2:39 PM, Pierre M <span dir="ltr"><<a href="mailto:piemas25@gmail.com" target="_blank">piemas25@gmail.com</a>></span> wrote:<br></div></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div dir="ltr"><div>Hi dancers, I manage to load Plack middlewares from <a href="http://app.pl" target="_blank">app.pl</a>, but not from the config.yml file.<br><br></div><div> *** In <b><a href="http://app.pl" target="_blank">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" target="_blank">http://advent.perldancer.org/2011/16</a><br><a href="http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod#Plack_middlewares" target="_blank">http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod#Plack_middlewares</a><br>
</div></div>
<br></div></div>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div></div>
<br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div>