Environment Variables

Environment Variables

List of environment variables that you can use with your Meteor application.

Here’s a list of the environment variables you can provide to your application.

BIND_IP

(production)

Bind the application server to a specific network interface by IP address, for example: BIND_IP=192.168.0.2.

See also: PORT.

In development, this can be accomplished with meteor run --port a.b.c.d:port.

DISABLE_WEBSOCKETS

(development, production)

In the event that your own deployment platform does not support WebSockets, or you are confident that you will not benefit from them, setting this variable with DISABLE_WEBSOCKETS=1 will explicitly disable WebSockets and forcibly resort to the fallback polling-mechanism, instead of trying to detect this automatically.

HTTP_FORWARDED_COUNT

(production)

Set this to however many number of proxies you have running before your Meteor application. For example, if have an NGINX server acting as a proxy before your Meteor application, you would set HTTP_FORWARDED_COUNT=1. If you have a load balancer in front of that NGINX server, the count is 2.

MAIL_URL

(development, production)

If you’re using an external mail service like Postmark, Mandrill, MailGun or SendGrid, you can provide a SMTP URL for your Meteor app to use to send e-mail. For example: MAIL_URL="smtp://user:pass@yourservice.com:587".

METEOR_SETTINGS

(production)

When running your bundled application in production mode, pass a string of JSON containing your settings with METEOR_SETTINGS='{ "server_only_setting": "foo", "public": { "client_and_server_setting": "bar" } }'.

In development, this is accomplished with meteor --settings [file.json] in order to provide full-reactivity when changing settings. Those settings are simply passed as a string here. Please see the Meteor.settings documentation for further information.

MONGO_OPLOG_URL

(development, production)

MongoDB server oplog URL. If you’re using a replica set (which you should), construct this url like so: MONGO_URL="mongodb://user:password@myserver.com:10139/local?replicaSet=(your replica set)&authSource=(your auth source)"

MONGO_URL

(development, production)

MongoDB server URL. Give a fully qualified URL (or comma-separated list of URLs) like MONGO_URL="mongodb://user:password@myserver.com:10139". For more information see the MongoDB docs.

METEOR_PACKAGE_DIRS

(development, production)

Colon-delimited list of local package directories to look in, outside your normal application structure, for example: METEOR_PACKAGE_DIRS="/usr/local/my_packages/". Note that this used to be PACKAGE_DIRS but was changed in Meteor 1.4.2.

PORT

(production)

Which port the app should listen on, for example: PORT=3030

See also: BIND_IP.

In development, this can be accomplished with meteor run --port <port>.

ROOT_URL

(development, production)

Used to generate URLs to your application by, among others, the accounts package. Provide a full URL to your application like this: ROOT_URL="https://www.myapp.com".

© 2011–2017 Meteor Development Group, Inc.
Licensed under the MIT License.
https://docs.meteor.com/environment-variables.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部