arboleya / electrify

Package your Meteor apps with Electron, and butter
MIT License
247 stars 52 forks source link

Setting system environment variables before meteor app is started. #64

Open ethanwillis opened 8 years ago

ethanwillis commented 8 years ago

Hello, I tried digging into your electrify code to see where I could include an additional script to set system environment variables before the meteor app is started.

My use case is that I want to create an electron app but point meteor to my hosted compose.io mongodb servers. I initially was going to set all my information in Meteor's settings.json... However settings.json is well known to not allow us to set the port for the mongo instance and other information.

If you would have any guidance on the chain of calls that happen up to and including the start of the meteor server I would love to do a PR for an enhancement to allow for other users to do what I'm aiming for!

Thanks, Ethan

ethanwillis commented 8 years ago

Quick update. It looks like I would modify main.js in .electrify/app and require a script at the top of the file that sets all of the system environment variables.

ray-man commented 7 years ago

@ethanwillis main.js is an automated generated file, how did you achieve requiring script at top of it ???