I started a phoenix project without using the --no-html option, and am now trying to ensure that the 404 and 500 errors render as JSON. The project started on Phoenix 1.1.0, and has been updated to 1.1.4.
I've modified the config/config.exs file's render_errors (under config :my_app, MyApp.Endpoint) to be [view: MyApp.ErrorView, format: "json", accepts: ~w(json)].
The routes all accept JSON and currently none of them accept HTML.
I've modified the web/web.ex file to remove the use Phoenix.HTML in the view function, and I've modified the web/views/error_view.ex to render JSON.
However at this point both 404 and 500 errors still return html.