The fourth session I attended was the highly energetic and speedy introduction to writing node.js and running it on Azure, presented by the author of Simple.Data and Simple.Web, and one of those voices of the developer community with a great JFDI attitude, Mark Rendle (@markrendle).
I’ve just recently got into node.js development myself and have been very much enjoying node, npm, express, stylus, and nib; there is a fantastic community and expanse of modules already and that can be a bit daunting.
During the session Mark’s short code example shows just how simple it can be to get up and running with node, and also how easy it is to deploy to Azure.
A nice comment was that we are on the road to “ecmascript harmony”! And that “Javascript is a great language so long as you ignore the 90% of it which coffeescript doens’t compile to.”
It was a very fast-paced session; hopefully my notes still make sense though..
What the various aspects of Azure do
- compute – web, worker, vm
- websites – .net, node, php
- storage – blob, tables (distributed nosql, like cassandra), queues
- sql – sql azure, reporting
- services – servicebus, caching, acs
What are the Cloud Service types used for
- web roles – iis, for apps
- worker – no iis, for running anything
How to peruse the contents of blob or table
General tips for developing sites for use in Azure
- keep static content in blob storage
- websites commit and deploy much faster than cloud serviecs commit and deploy process
- azure/iis needs server.js, not app.js
How to run RavenDB in Azure
- Spin up a vm and install it!! (this used to be a much trickier process, but the recent Azure update meant that the VM support is mature enough to allow the simpler solution)
Developing node.js
Use jetbrains webstorm for debugging/ or the wonderful online editor, Cloud9IDE. Sublime Text 2 is a great editor for simple code requirements, and has great plugins for Javascript support. I also used this for taking all of the seminar notes as it has a simple “zen” zero-distractions interface
Next up – Hadoop and High Performance Computing
Nice post
On server.js, for websites we automatically recognize app.js or server.js. So for example if you use the express scaffolding tool which creates app.js it will work file.
If you are creating a cloud service you can modify the web.config to recognize app.js if you prefer it, though server.js is the default.