Remove NoRouteError 404 Phoenix 1.4

Trying to make it so that it just renders a 404 message instead of showing all of the available routes but I can’t seem to change anything. I’ve tried removing

def template_not_found(template, _assigns) do
  Phoenix.Controller.status_message_from_template(template)
end

and adding

def render("404.html", _assigns) do
   "Internal Server Error"
end

in AppWeb.ErrorView but nothing seems to happen.

1 Like

This page shows only in development. You can disable debug_errors in your config/dev.exs file and you will see how it will work in production. (OR you can also run your server in prod to see how it looks like).

5 Likes