In Phoenix the PageController
seem to be the default controller with the function :index
which renders the index.html.eex
for the port http://0.0.0.0:4000/
Lets say i want instead to load SessionController
:new
function when i visit http://0.0.0.0:4000/
. What is the best way to implement this?
I tried this approach in PageController
but it seemed not to work
def index(conn, _params) do
conn
|> redirect(to: session_path(conn, :new))
end