Hi all. I have a simple web-app with Dancer2, separated for two apps:

MyApp->to_app; builder { enable 'Deflater'; mount '/' => MyApp->to_app; mount '/json' => MyApp::Controller->to_app; }
one for serving content (pages etc) and one for handling JSON API;

When im trying to set up serializer engine from config.yml, like this:

serializer: "JSON" engines: serializer: JSON: pretty: 1 allow_blessed: 1 canonical: 0 utf8: 1
app serving pages ceases to work (probably, because it tries to use JSON-serializer).

All works with

set serializer => 'JSON';
in my controller app, but this way i lost ability to customize serialization settings (at least because i dont understand how). With your permission, I will not show examples of attempts to you - they are uncomplicated and uneffective. How can i customize config setting from code (or not from code) for my second app?

With best regards, Vlad.


In reply to Dancer2: config UTF8 for JSON serializer from code by TheTailgunner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.