Packages

Show all routes on accessing a non-existing route.

Current section

Files

Jump to
not_found_route lib not_found_route_web router.ex
Raw

lib/not_found_route_web/router.ex

defmodule NotFoundRouteWeb.Router do
use NotFoundRouteWeb, :router
defmacro live_not_found(opts \\ []) do
if Mix.env() in [:dev] do
quote bind_quoted: binding() do
scope "/", alias: false, as: false do
import Phoenix.LiveView.Router, only: [live: 4]
live "/*anything", NotFoundRouteWeb.OverviewLive, :index,
layout: {NotFoundRouteWeb.LayoutView, :root}
end
end
end
end
end