TheTailgunner has asked for the wisdom of the Perl Monks concerning the following question:
Hi all. I have a simple web-app with Dancer2, separated for two apps:
one for serving content (pages etc) and one for handling JSON API;MyApp->to_app; builder { enable 'Deflater'; mount '/' => MyApp->to_app; mount '/json' => MyApp::Controller->to_app; }
When im trying to set up serializer engine from config.yml, like this:
app serving pages ceases to work (probably, because it tries to use JSON-serializer).serializer: "JSON" engines: serializer: JSON: pretty: 1 allow_blessed: 1 canonical: 0 utf8: 1
All works with
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?set serializer => 'JSON';
With best regards, Vlad.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dancer2: config UTF8 for JSON serializer from code
by 1nickt (Canon) on Sep 15, 2017 at 12:15 UTC |