Let’s use the add on service to our Microsoft Azure cloud tenant, augmenting the fabric with mongodb:
so when we apply the following:
we get a working mongodb instance
mongo ds052837.mongolab.com:52837/mongodb -u pwilliams –p …
now we work a tutorial from node.js to our mongodb db/collection (before even attempting the NAR node.js integration with this instance):
our connection string, from azure, is mongodb://mongodb:yilxWKhgqv17AHdd3P4ur3PkYJxwkwVpdjCE6.CctrAfirstname.lastname@example.org:52837/mongodb
we learn to install express (the scaffolding tool for the express web app framework)
and upon using the tool, we get output similar to that suggested in the tutorial:
Per instructions we ‘npm install’
And install the “mongoose” db driver
Using visual studio and a nominal project, we then modify the application, per instructions (largely, with exceptions in app.js).
we assign the environment connection string, per instructions:
Clearly, we have a basic website up and running:
now, the site doesn’t work (but then we didn’t feel the instructionsquite matched what we were seeing from the expected express scaffolding).
so we start again, this time using the microsoft express project type (to which we then add the controllers, routers, and app hookups, as per the instructions); again.
Now we have success, once we publish to the same website as used earlier, replacing code:
With that done, we see clearly that the webapp’s post b ack page works, since we can see records in the db – using its management console:
Now we have see one express project, talking to our mongodb instance via the mongoose driver, we can go have a more careful look at the NAR code. Perhaps we can see how to make it talk to our mongodb instance, now, and then host it too in the azure cloud.