如何在CompoundJS中切换环境? [英] How to switch environment in CompoundJS?

查看:101
本文介绍了如何在CompoundJS中切换环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对CompoundJS非常陌生.我正在研究访问MongoDB中数据的示例应用程序.我想知道是否有任何方法可以像在Rails中那样在CompoundJS中切换环境(RAILS_ENV =开发/测试/生产).任何帮助,将不胜感激.预先感谢.

I'm very new to CompoundJS. I'm working on a sample application which accesses data in MongoDB. I'm wondering if there is any way to switch environment in CompoundJS as we do in Rails (RAILS_ENV = development/test/production). Any help would be appreciated. Thanks in advance.

推荐答案

像在nodejs中一样,您可以使用NODE_ENV变量(与ruby/rails中的RAILS_ENV相同):

As usual in nodejs you can use NODE_ENV variable (same as RAILS_ENV in ruby/rails):

NODE_ENV=production node .

应该为化合物工作(来自化合物项目的工作目录).

Should work for compound (from the working dir of your compound project).

这篇关于如何在CompoundJS中切换环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆