Detect Meteor environment?

I would like to know how can we detect whether meteor is running in development or production environment?

Thanks


You can use process for that, another approach is to use fs and check a file which you put in your dir which is different depending on the environment your application is in.

I think the best approach would be to use process.env and checking out COMPUTERNAME .


Use " meteor_runtime_config .ROOT_URL"

This returns ROOT_URL environment variable.

It's a simplest way to detect environment.

You can set this value in .bash_profile, or .profile

export ROOT_URL=http://YOURDOMAIN.com
链接地址: http://www.djcxy.com/p/59592.html

上一篇: 通过使用sandcastle将示例代码放在文档中

下一篇: 检测流星环境?