Created
September 6, 2020 16:31
-
-
Save nkezhaya/5ae9a9eb946736f92ad9ddcb3286945f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule MyAppWeb.RouteForwarder do | |
| def init(opts), do: opts | |
| def call(%Plug.Conn{request_path: "/api/" <> _} = conn, opts) do | |
| MyAppWeb.APIRouter.call(conn, opts) | |
| end | |
| def call(conn, opts) do | |
| MyAppWeb.Router.call(conn, opts) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment