I would like to know what is the proper way to achieve the following :
In one main router file :
scope "/", MyApp do
"/subScope1" call_SubScope1
"/subScope2" call_SubScope2
...
end
and in different “subrouter” files, one for each SubScopei
:
scope "/", MyApp do
get "/action1" controllerSubScopei, :action1
get "/action2" controllerSubScopei, :action2
...
end
I looked into the forward
function, which looked lie the way to achieve this (even though I’m not sure of that), but was unable to use it so far : when I try to create another router Module, with these three lines :
use Phoenix.Router
import Plug.Conn
import Phoenix.Controller
I get an error msg telling me that init
function is not defined.