您需要将应用程序层与数据库层分开,这意味着要指定MONGO_URL。这意味着通过bundle命令运行您的应用程序,解压缩它,设置环境变量,然后将其作为节点应用程序启动。这是如何做...
#make sure you're running the node v0.10.21 or later npm cache clean -f npm install -g n sudo n 0.10.21 # bundle the app mkdir myapp cd myapp git clone http://github.com/myaccount/myapp meteor bundle --directory ../deployPath cd ../deployPath # make sure fibers is installed, as per the README export MONGO_URL='mongodb://127.0.0.1:27017/mydatabase' export PORT='3000' export ROOT_URL='http://myapp.com' # run the site node main.js