I am planning make some static page so,
I am making 2 subfolder in controller like this :
frontend
backend
for frontend folder i make subfolder like this :
fe_landing
for backend folder i make subfolder like this :
be_landing
for fe_landing folder i make file like this :
home.html.heex
about.html.heex
service.html.heex
contact.html.heex
for be_landing folder i make file like this :
home_controller.ex
home_html.ex
about_controller.ex
about_html.ex
service_controller.ex
service_html.ex
contact_controller.ex
contact_html.ex
in my home_controller.ex i code like this :
defmodule MyappWeb.Backend.BeLanding do
use MyappWeb, :controller
def home(conn, _params) do
render(conn, :home, layout: false)
end
end
in my home_html.ex i code like this :
defmodule MyappWeb.HomeHTML do
use MyappWeb, :html
embed_templates "../../frontend/fe_landing/*"
end
in my router.ex i code like this :
scope "/", MyappWeb do
pipe_through :browser
get "/fe_landing", HomeController, :home
end
when to running this app, showing error like this :
Phoenix.Router.NoRouteError at GET /
no route found for GET / (Myapp.Router)
i would like to change the default page_controller.ex and page_html.ex is to subfolder controller → backend → be_landing home_controller.ex and home_html.ex, i mean i don’t want to use that page_controller.ex and page_html.ex
how to solved that