Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule Helix.API.Router do
- @moduledoc """
- This is where you add your routes
- """
- defmacro __using__(_options) do
- [project, module] = Module.split(__CALLER__.module)
- project = String.to_atom(project)
- module = String.to_atom(module)
- quote do
- Phoenix.Router.pipeline :helix_api do
- plug(:accepts, ["json"])
- end
- scope "/helix/api/v1/module", unquote(project) do
- pipe_through(:helix_api)
- get("/:module/", unquote(module), :all)
- get("/:module/settings", unquote(module), :settings)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement