Created
February 23, 2021 15:35
-
-
Save paulanthonywilson/586a0e5a278238207e527f697cddcaf7 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 MasterProxy.Proxy do | |
@moduledoc """ | |
Simple plug to act as a proxy (for Heroku). It inspects the path and calls the appropriate endpoint. | |
""" | |
def init(options), do: options | |
def call(conn, _) do | |
if String.starts_with?(conn.request_path, "/admin") do | |
Admin.Endpoint.call(conn, []) | |
else | |
EmployeeUi.Endpoint.call(conn, []) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment