Environment Variables when deploying Meteor

僤鯓⒐⒋嵵緔 提交于 2019-12-24 12:28:25

问题


Other than PORT, MONGO_URL, where can we find the documentation for all the environmental variables that's exposed by Meteor?

In the Meteor docs, I can only find this line

PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp node bundle/main.js

Is there a variable that combines all the JS files and minifies them?


回答1:


I've been using grasp to answer your question. Here is the command line I used:

grasp -reo --no-line-number --no-color --no-filename process.env.__ . 2> /dev/null | sort | uniq | cut -c 17-

And here is the result on the devel branch:

_
ADMIN_APP
APP_CONFIG
APPDATA
AUTOUPDATE_VERSION
BIND_IP
COMP_CWORD
COMP_LINE
COMP_POINT
COMPUTERNAME
ComSpec
DDP_DEFAULT_CONNECTION_URL
DEBUG
DEBUG_MIME
DEBUG_NOPT
DESTDIR
DISABLE_WEBSOCKETS
EDITOR
GALAXY
GALAXY_APP
GALAXY_JOB
HOME
HOSTNAME
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
JOBS
LAST_START
MAIL_URL
MAKE
METEOR_SETTINGS
MONGO_URL
NODE_BINDINGS_ARROW
NODE_BINDINGS_COMPILED_DIR
NODE_DEBUG
NODE_ENV
NODE_NDEBUG
NOPT_DEBUG
npm_config_proxy
path
Path
PATH
PATHEXT
PORT
PREFIX
PROMPT
PS1
PWD
PYTHON
ROOT_URL
ROUTE
SERVER_ID
SHELL
SUDO_GID
SUDO_UID
SystemDrive
TEMP
TMP
TMPDIR
ULTRAWORLD_DDP_ENDPOINT
USE_JSESSIONID
USER
USERDOMAIN
USERNAME
USERPROFILE
VISUAL
windir

Most of thoses environment variables are not documented yet.

About minifing all js and css files, you can use the --production parameter:

meteor run --production

To get the documentation use the --help parameter:

meteor run --help



回答2:


The easiest way to discover what exists "under the covers" of any open source project is to look at its source code. A simple grep "process.env" * at the top of the meteor source tree will show you every instance of Meteor's use of the process environment.

Alternately, you can visit Meteor's github and search for 'process.env'. Doing this should display thirty matches.



来源:https://stackoverflow.com/questions/20600887/environment-variables-when-deploying-meteor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!