Skip to content

Instantly share code, notes, and snippets.

@damonvjanis
Last active April 6, 2023 03:38
Show Gist options
  • Save damonvjanis/24f83da1c982e7ab4e4bffc543d5ff2f to your computer and use it in GitHub Desktop.
Save damonvjanis/24f83da1c982e7ab4e4bffc543d5ff2f to your computer and use it in GitHub Desktop.
import Config
# Set ports based on environment variables in the release
http_port = System.get_env("HTTP_PORT")
https_port = System.get_env("HTTPS_PORT")
if http_port && https_port do
config :my_app, MyAppWeb.Endpoint,
http: [port: String.to_integer(http_port)],
https: [port: String.to_integer(https_port)]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment