Created
August 11, 2017 04:43
-
-
Save matthunz/680aba34475059bea33199a8cea17d47 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
| full_url = fn -> | |
| port = case @port do | |
| 80 -> | |
| "" | |
| _ -> | |
| ":" <> Integer.to_string(@port) | |
| end | |
| "http://" <> conn.host <> port <> "/" <> short_url | |
| end | |
| conn |> Plug.Conn.resp(200, full_url.()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment