Skip to content

Allow user to signal they're in server process via environment variable #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Allow user to signal they're in server process via environment variable #31

merged 1 commit into from
Feb 19, 2024

Conversation

steve21168
Copy link
Contributor

@steve21168 steve21168 commented Feb 15, 2024

RailsLiveReload currently relies on the ::Rails::Server being available to run, I'm assuming this is just a proxy for understanding that you're in a server process and when Rails users start up their server with rails s this works great.

However my team, and I would think many others may be calling puma or their other web server directly to start their Rails server. rails s has a limited set of options, and it doesn't seem to even respect most of the options in the context of puma (port/bind options). For that reason my team calls bundle exec puma directly and passes it different config files per environment.

All that being said this small PR gives users the option to tell RailsLiveReload through environment variables that it is indeed in a server process, and thus safe to start up.

This may also help solve: #30

@manastyretskyi manastyretskyi merged commit 4643b86 into railsjazz:main Feb 19, 2024
@manastyretskyi
Copy link
Contributor

Thanks @steve21168, I will release new version later today.

@courtsimas
Copy link

courtsimas commented Nov 30, 2024

I wish this had made its way to the readme. Pretty helpful to have this optional env var set and run things through puma directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants