Is there a way to create persistent environment variables that apply on a per-app basis? For example, say I have two node apps running on my webfaction account. I want one to have a I found this question and answer but the solution there would have the variables apply across all apps, I think. asked 13 Sep '15, 10:39 negatron |
You can export your variables in your node's start script at the You can write the following line for example ...
... and you should then be able to access it with your code using You can have multiple lines like that, passing any variable you want, but please note that they should be declared before the line starting with nohup. answered 13 Sep '15, 11:33 iliasr ♦♦ That's brilliant, thank you! I assume that doing this will not effect other apps running on the same account right?
(13 Sep '15, 11:56)
negatron
No, it shouldn't. The export commands in the start script will make the environment variables available only for the processes started by that script. Other processes under the same username will not be able to have direct access to the them.
(13 Sep '15, 12:03)
iliasr ♦♦
This is exactly what I need then, thanks a lot!
(13 Sep '15, 12:07)
negatron
|