How to connect MeteorJs with remote MongoDB?

0

Hi everyone, I have my MeteorJS App that connects to your database, but I need to connect it to my Robomongo external, that is my MongoDB strong> runs on a different port

Some advances:

in my windows console:

MONGO_URL=mongodb://127.0.0.1:27017/basedatos meteor run
    
asked by Rastalovely 01.11.2016 в 23:55
source

2 answers

0

Be sure to define your environment variable MONGO_URL with the path of your database before executing the meteor command.

Your variable should be defined like this:

MONGO_URL=mongodb://ip_de_tu_servidor:puerto/nombre_de_tu_bd  

example

MONGO_URL=mongodb://127.0.0.1:27017/meteor 

confirms the stored route with echo $MONGO_URL

    
answered by 29.11.2016 / 16:18
source
0

To avoid placing the url of your connection when you run the application, I recommend creating a file of environment variables env.sh

and place the following content in the file:

# This .sh file will be sourced before starting your application.
# You can use it to put environment variables you want accessible
# to the server side of your app by using process.env.MY_VAR
#
# Example:
# export MONGO_URL="mongodb://localhost:27017/myapp-development"
# export ROOT_URL="http://localhost:3000"
    
answered by 07.01.2017 в 21:05