如何在同一个数据库中启动多个应用程序?

问题描述:

我必须在本地(管理员和客户端)使用流星应用程序.应用程序运行在不同的端口 30003003 上.我想同时使用这两个应用程序应该使用相同的数据库.export MONGO_URL=mobgodb://127.0.0.1:3001/meteor 就可以了.但我想知道任何参数与流星命令传递以设置环境变量以使用相同的数据库.

I have to meteor application in local (admin and client). Applications run on different port 3000 and 3003. I want to use both app should use the same DB. export MONGO_URL=mobgodb://127.0.0.1:3001/meteor will be okay. But I would like to know any argument to pass with meteor command to setup environment variable to use the same DB.

如果您正在寻找启动脚本,您可以执行以下操作:

If you are looking for a start script you could do the following:

在您的应用程序的根目录中,创建一个名为 start.sh 的文件:

In the root of your app, create a file called start.sh:

#!/usr/bin/env bash
MONGO_URL=mobgodb://127.0.0.1:3001/meteor meteor --port 3000

然后运行chmod +x start.sh

然后您只需输入 ./start.sh