0

I am deploying nodejs app with mongodb db with collections/data in it. I have it under the data/db directory. it doesn't have username / password. but with the appfog the service has the user name/password. how does the mongodb service know to start with the db I deployed.

Thanks

Al Sargent
  • 46
  • 7
coool
  • 8,085
  • 12
  • 60
  • 80

1 Answers1

0

When you create the MongoDB client you should pass server host/port and authentication information to it.

usually on hosted services such as Heroku or Appfog this info is provided in evncironment variables which can be accessed with process.env.VARIABLE_NAME

Gal Ben-Haim
  • 17,433
  • 22
  • 78
  • 131