Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Meteor environment?

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

Thanks

like image 597
George Yacoub Avatar asked May 18 '12 05:05

George Yacoub


2 Answers

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.

like image 133
Tamara Wijsman Avatar answered Oct 13 '22 20:10

Tamara Wijsman


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
like image 41
spectrum Avatar answered Oct 13 '22 20:10

spectrum