Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. defmodule Helix.API.Router do
  2. @moduledoc """
  3. This is where you add your routes
  4. """
  5. defmacro __using__(_options) do
  6. [project, module] = Module.split(__CALLER__.module)
  7. project = String.to_atom(project)
  8. module = String.to_atom(module)
  9.  
  10. quote do
  11. Phoenix.Router.pipeline :helix_api do
  12. plug(:accepts, ["json"])
  13. end
  14.  
  15. scope "/helix/api/v1/module", unquote(project) do
  16. pipe_through(:helix_api)
  17.  
  18. get("/:module/", unquote(module), :all)
  19. get("/:module/settings", unquote(module), :settings)
  20. end
  21. end
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement