I am running 2 NodeJS servers. One serves the angular-ui-router front-end. The other serves the data. I run them both by giving the same command in two different directories: node server.js
So I have the two server.js files, plus the app.js file for the front-end (with the urls/states) and an index.js file for the back-end (with the urls/endpoints).
I'd like to configure them to use either http or https.
This means adding a flag in each server-js file, as well as changing the module.constant declarations in the app-js file.
Is there a way for the code in the app-js file to access something declared in the front-end server-js file? Or do I always need to change 3 files to switch between http and https?