On 2015-10-27 02:28 PM, Alexis Sukrieh wrote:
> Also, given that D2 provides a clean scoping (thanks Apps!) it's not
> such a problem we're now stricter. If you want both, just put the
> serializers in an app and you're done.

Just to illustrate (as we are discussing something along those lines on
the dev side), that could look like:


        use 5.20.0;

        package MyApp::Templatey {
                use Dancer2;

                set template => 'Simple';

                get '/templated' => sub { template "templated" };
        }

        package MyApp::Serializish {
                use Dancer2;

                set serializer => 'JSON';

                get '/serialized' => sub { $some_struct };
        }



The final application will have the routes '/templated' and
'/serialized', and they will both act as per their names. The end-user
will never know, but for the developer the existence of both sub-apps
mean that the behaviours are nicely segregated.

Joy,
`/anick
_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to