2

I have created a node app that uses a mongodb database, but I dont know how to connect to a database that is running on a virtual machine. Because I am poor, I decided to put my mongodb database on a virtual machine on Windows Azure. My Node app is hosted on a heroku server, and now I'd like to connect the two together. How do I connect the node app to the mongodb database?

This is the guide I used to create my mongodb database: http://docs.mongodb.org/ecosystem/tutorial/install-mongodb-on-linux-in-azure/

I am guessing I need to put in the connection URL obtained from the guide above (mongodb://mongodbrs.cloudapp.net:27018) into my node app when I call "mongoose.connect([URL])". Is this right? If so, how would I authenticate with the windows azure virtual machine?

#poorpeopleproblems

  • 1
    MongoHQ and MongoLab both have free tiers why azure? – generalhenry Apr 15 '13 at 21:31
  • In Heroku, the MongoLabs/MongoHQ free tier only allows ~512MB of storage, where I can get ~100 GB on Azure for free :) – user2284028 Apr 15 '13 at 22:00
  • 1
    this doesn't answer the question, but you've introduced potentially considerable latency AND bandwidth charges into your solution now. If you like MongoDB on Azure, wny not also put node.js there (in a free WebSite offering)? As for auth, you'd do whatever you'd do to secure Mongo on a public facing endpoint, there's no authentication per se with the Azure VM, once you open a port it's open for all. – Jim O'Neil Apr 16 '13 at 05:02

0 Answers0