Environment Variables

Since MUP isn’t working for me since 1.3 was launched I’m resorting to a manual deployment. But, where the hell do you put environment variables!?

I can launch with something like:

MONGO_URL=mongodb://ip here:27017/ ROOT_URL=http://url.here node main.js

But I’d prefer to deploy with environment variables already set. Does it go in package.json? If so, where?

I have to say, deployment has become a real pain since 1.3 was launched.

Thanks,

Tom.

1 Like

I recommend using the “pauldowman:dotenv” Meteor package. Of course, there are other ways to define ENV vars, so you might prefer a different solution.

Thanks @morganpattens, I’d not seen that package before.

I know you can do something like:

Meteor.startup(function () {
  process.env.MAIL_URL = 'smtp://mail.url.here';
});

But I have no idea if that works when you deploy as it generally wants the environment variables in order to deploy.

Sorry, I usually deploy to Heroku via git. It seems you run node direct? Perhaps look at a solution like Phusion Passenger?