Reputation: 6346
Setting an environment variable on the localhost is done using export
.
e.g. export PORT=80
My Question is how to set an environment var for the remote meteor server.
I am using Meteor's free hosting service and deploy using meteor deploy appname
, and therefore have no ssh access to the remote command line.
I'd like to set DISABLE_WEBSOCKETS
to true.
I've looked at the list of possible meteor commands and haven't found one which relates to setting env vars.
Upvotes: 3
Views: 2011
Reputation: 75945
You do it the same way when you run your server e.g, you don't have to use export
you can just put the environment variables in the line you use to start meteor.
PORT=80 node main.js
or if you use forever
PORT=80 forever start main.js
or even with meteor
DISABLE_WEBSOCKETS=TRUE meteor
I'm a bit confused about your setup, by remote meteor server you mean a production environment? You shouldn't use the meteor
command in production as it is not optimized this way and performance would be very significantly affected.
Meteor gets the environment variables using process
so whatever you use to start the process you can pass the environment variables to it using the typical terminal/bash/shell/ssh that you used to start the process up.
Upvotes: 6