Moving An Existing Node.js App To Run On BlueMix
Over the past few weeks I have been teaching myself about Node.js. One of the tutorials I followed was a step by step guide to getting up and running with Node.js, Express, Jade, and MongoDB. After I finished the tutorial and had the app running locally I wanted to get it deployed in the cloud on BlueMix, so I began to investigate what I had to modify in order to do this. After reviewing the code one thing jumped out to me the I knew immediately would be a problem. Want to take a guess at what that is? No? OK, it is the URL to the Mongo database. After completing the tutorial you are left with an app that had a hardcoded DB URL. Obviously deploying the code with the hardcoded URL was not going to work. First before I go into what I had to change, I think a little background is necessary.