2016-02-12 8 views

Odpowiedz

0

Jak @Martimatix wskazał $ mix phx.routes wydrukować wszystkie trasy dla domyślnego routera, oto documentation

To jest przykład tras wygenerowanych dla tego router.ex pliku:

defmodule MessageApi.Router do 
    use MessageApi.Web, :router 

    pipeline :api do 
    plug :accepts, ["json"] 
    end 

    scope "/api", MessageApi do 
    pipe_through :api 

    resources "/messages", MessageController, except: [:new, :edit] 
    resources "/message_details", MessageDetailController, except: [:new, :edit] 

    end 
end 

wygenerowane trasy będą następujące:

 message_path GET  /api/messages    MessageApi.MessageController :index 
     message_path GET  /api/messages/:id   MessageApi.MessageController :show 
     message_path POST /api/messages    MessageApi.MessageController :create 
     message_path PATCH /api/messages/:id   MessageApi.MessageController :update 
        PUT  /api/messages/:id   MessageApi.MessageController :update 
     message_path DELETE /api/messages/:id   MessageApi.MessageController :delete 
message_detail_path GET  /api/message_details  MessageApi.MessageDetailController :index 
message_detail_path GET  /api/message_details/:id MessageApi.MessageDetailController :show 
message_detail_path POST /api/message_details  MessageApi.MessageDetailController :create 
message_detail_path PATCH /api/message_details/:id MessageApi.MessageDetailController :update 
        PUT  /api/message_details/:id MessageApi.MessageDetailController :update 
message_detail_path DELETE /api/message_details/:id MessageApi.MessageDetailController :delete