mascip has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm using Dancer2 (0.10) on Perl 5.16.3.
I manage to load Plack middlewares from app.pl, but not from the config.yml file.
*** In app.pl I have:
use Plack::Builder; builder { enable 'Debug', panels => [qw<Memory Timer>]; HabitLab->dance; };
which works perfectly.
*** Here is what i put in config.yml instead (and which doesn't work) :
layout: "main" plack_middlewares: - - Debug - panels - - Memory - Timer
I know that the config file is used, because my "main" layout is used. And I know that this YAML is valid, and produces the following structure (outputed with Data::Printer) :
\ { plack_middlewares [ [0] [ [0] "Debug", [1] "panels", [2] [ [0] "Memory", [1] "Timer", ] ] ] }
But the middleware doesn't work in this case. What have I missed?
I've followed the examples from here and there:
http://advent.perldancer.org/2011/16 http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod#Plack_middl +ewares
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Plack middlewares not loaded from Dancer config ( Dancer2 is not Dancer)
by Anonymous Monk on Oct 22, 2013 at 00:43 UTC | |
by Anonymous Monk on Oct 22, 2013 at 00:51 UTC | |
by mascip (Pilgrim) on Oct 23, 2013 at 07:19 UTC | |
Re: Plack middlewares not loaded from Dancer config
by Anonymous Monk on Oct 20, 2013 at 01:33 UTC | |
by mascip (Pilgrim) on Oct 21, 2013 at 11:47 UTC | |
by choroba (Cardinal) on Oct 21, 2013 at 11:56 UTC |
Back to
Seekers of Perl Wisdom