Conversation
@@ -151,6 +152,15 @@ server.register(inert, () => { | |||
}); | |||
|
|||
|
|||
if (process.env.NODE_ENV === 'production') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could check here for another environment variable if present. Not sure if Heroku is used and what is set exactly, so let me know.
ping @fmarier |
Ping @fmarier |
On a side note, I have personally switched to Node.js 10.x. Should I make the same here too? Otherwise I can't rebase/update the deps or anything. |
@XhmikosR since this is open-source, it might be good to wait until October when Node.js 10 gets LTS. |
I don't see how it's related. I use it, and I'm not going to install 8.x to make changes to this project only. |
For easy Node switching you can use It's related because some people may not be able to use Node 10 in their work environments due to it not being LTS yet. You don't know how else this code is being used or by whom, and imho, it seems unnecessarily restrictive to force users to use Node 10 for this code. |
I know all of these, but I'm on Windows. Sorry, I'm not going to change my workflow. The node 10.x switch seems fine to me, I'm using it for months without an issue. I don't see anyone else doing anything on this project apart from me. |
@mozfreddyb: can you share a few details about the Heroku env? Here I rely on an environment variable which I assume is set on Heroku to force the redirect to https. |
I don't think we're setting any env variables in heroku itself. It just does |
OK, then this should work out of the box since I'm setting Can we test this somehow before merging it? |
I don't think so. I'll carve out some time later this week to test-deploy and roll back if things go horribly wrong |
@mozfreddyb: how do you want to proceed with this? |
I'm gonna close this for now. I will keep the branch in this repo if we need it again. |
If the production script is running
npm start
this will work out of the box. Otherwise we might need to set the env varNODE_ENV
toproduction
.Requires the previous PRs merged.
Fixes #122.
/CC @fmarier