Replies: 1 comment
-
Thanks for writing this up @johlym. I've been laser-focused on just getting 1.0 out the door, so now that the dust is settling I can give this some more thought. 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I wrote this out, it turned out to be more opinionated than I originally imagined. I decided this is better served as a Discussion topic than a feature request. Otherwise, I've copied everything as is.
Summary
In addition to $BRIDGETOWN_PORT, having support for binding to (and looking for) $PORT, too, or perhaps instead, would allow support for more deployment environments.
Motivation
Some platforms (Heroku comes to mind) require that apps bind to the
$PORT
env var on boot. It's fine to updateconfig/puma.rb
to swapBRIDGETOWN_PORT
forPORT
(example) and have a functioning installation. Still, Bridgetown proper doesn't follow that change, so even when configured correctly in the same file, Bridgetown defaults to4000
everywhere else. When using Puma, the net effect is incorrect messaging on boot, which can lead to confusion and distraction when debugging.Alternatively, describing an arbitrary env var to reference for binding would also solve this.
Reference-level explanation (and a drawback)
I can think of at least two edge cases.
The first is that one wishes to have multiple unique processes running in tandem. However, in environments with a specific port to bind to exists, support for multiple processes is limited.
The second is (also a drawback) that existing operations on some platforms may expect BRIDGETOWN_PORT to be the reference for which port to bind to and may not behave properly when this is changed.
Unresolved Questions
What is the backstory for choosing
BRIDGETOWN_PORT
as the bind reference or something more agnostic?Editing to add that I ran into the exact debugging scenario this morning, and went down the wrong path because I had forgotten about the nuance of "configure Puma" and "Bridgetown output is no longer trustworthy."
Also, I'm reminded of my tweet from November when I first ran into this. https://twitter.com/_johlym/status/1455762779013402631
Beta Was this translation helpful? Give feedback.
All reactions