ionicc / Github-organization-inviter

Automate inviting users to your Github Organzation!
4 stars 7 forks source link

Prefer environment variable over hardcoded value #17

Closed Ryuno-Ki closed 4 years ago

Ryuno-Ki commented 5 years ago

This is a follow-up of #8.

https://github.com/ionicc/Github-organization-inviter/blob/5381d04484b94a64d836c6b215ce67827fa58e72/main.js#L21 shows that there would be a way to modify the served port. However, since 8000 is truthy, the right hand side (process.env.PORT) is never evaluated. Switch the order and you are good to go.

ionicc commented 5 years ago

Ah yeah, I did this because of the Nginx reverse proxy I've used in my production version. It's easy to map the port in Nginx config if you have a hardcoded/constant port value. If we shift it to process.env.PORT then how will we dynamically map the ports?

Ryuno-Ki commented 5 years ago

Not sure, whether I get you here. Dynamic port mapping?

node main.js  # port 8000
PORT=8080 node main.js  # port 8080
hood commented 4 years ago

This could be closed now.

Ryuno-Ki commented 4 years ago

Thanks forthe PR!