MongoDB connection error: [Error: failed to connect to [undefined:27017]]

257 views
Skip to first unread message

JUNIOR FERREIRA

unread,
Feb 25, 2016, 5:17:43 PM2/25/16
to restify

where is the configuration file mongo bank?



Paolo Nicorelli

unread,
Feb 26, 2016, 2:25:36 AM2/26/16
to res...@googlegroups.com
you must set the MONGO_URL's env variable (the one in line 5).

I suppose:
- you're on a linux (or POSIX) system
- you're running mongo on localhost and you want to connect to `myapp` db.
- you launch the app with `node index.js`

then on the shell

export MONGO_URL='mongodb://localhost/myapp'
node index.js


The error is process.env.MONGO_URL is not set so it's `undefined`.

Hope this help


On 25 February 2016 at 23:17, JUNIOR FERREIRA <web2...@gmail.com> wrote:

where is the configuration file mongo bank?



--
You received this message because you are subscribed to the Google Groups "restify" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restify+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages