Phoenix.Jiffy
JSON Engine replacement for Phoenix. Mimics default JSON engine (Poison
), but uses
Jiffy under the hood.
Installation
If available in Hex, the package can be installed as:
Add
phoenix_jiffy
to your list of dependencies inmix.exs
:def deps do [{:phoenix_jiffy, "~> 0.1.0"}] end
Ensure
phoenix_jiffy
is started before your application:def application do [applications: [:phoenix_jiffy]] end
Add to
config/config.exs
:config :phoenix, :format_encoders, json: Phoenix.Jiffy
Change your
endpoint.ex
:defmodule MyApp.Endpoint do use Phoenix.Endpoint, otp_app: :my_app ... plug Plug.Parsers, parsers: [:urlencoded, :multipart, :json], pass: ["*/*"], json_decoder: Phoenix.Jiffy ... end