部署Meteor应用程序时如何指定MongoHQ数据库? [英] How do I specfiy a MongoHQ database when deploying Meteor app?
问题描述
在使用meteor deploy
部署Meteor应用程序时,我想使用自己的MongoHQ数据库. 文档说明了在我控制的计算机上部署和运行时如何执行此操作:
I would like to use my own MongoHQ database to use when deploying a Meteor app using meteor deploy
. The documentation explains how to do this when deploying and running on a machine I control:
$ PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp node bundle/main.js
但是有关如何使用meteor deploy
执行此操作的文档似乎很少.有可能吗?
But the documentation seems a bit sparse on how to do this with meteor deploy
. Is it possible?
我尝试按照 http://docs.meteor.com/#meteor_settings 进行添加一个settings.json文件并放入其中:
I tried following http://docs.meteor.com/#meteor_settings and added a settings.json file and put in it:
{"MONGO_URL" : "mongodb://user:pass@mongohq.com:10000/mydatabase"}
然后使用
meteor deploy myappname.meteor.com --settings settings.json
但是部署的版本没有使用我的数据库
but the deployed version doesn't seen to be using my database
推荐答案
I ended up deploying to Heroku instead using the buildpack. Then I could set the variables using the heroku configs.
这篇关于部署Meteor应用程序时如何指定MongoHQ数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!