By Domenic Denicola
2012.10.02

How to Write Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Read more...
By Matias Woloski
2012.09.19

Nodeblog static blog engine now running on Windows Azure Web Sites

When Windows Azure added support for node.js a year ago, we thought that it would be a good idea to try hosting a static blog engine on a worker role running node. So after some research we've found wheat and after some hacking here and there we were able to run a git repo on the worker role and accept a github hook notification whenever content was pushed to https://github.com/woloski/nodeonazure-blog.

Read more...
By Tomasz Janczuk
2012.05.24

Develop on Mac, host on GitHub, and deploy to Windows Azure

If you are like most node.js developers, you develop your code on a Mac and host it on GitHub. With git-azure you can now deploy that code to Windows Azure without ever leaving your development environment.

Read more...
By Matias Woloski
2012.04.29

Creating a collaborative realtime markdown editor - the "Google Docs" for Markdown

Markdown is getting a lot of traction in the development community. For instance, I am using it to edit the articles of this blog, to edit the README on github, to write documentation, in a CMS, in a wiki, in a jekyll-based site, in tumblr etc. We like it because of its lightweight nature that makes you focus on the content instead of the form.

This article explains how MarkdownR http://markdownr.cloudapp.net/ works and it is separated in the following parts:

  • Why implementing a collaborative realtime markdown editor?
  • Finding the right building blocks
  • Building the v0.1
  • Adding support for copy paste in Google Chrome
  • Import/export from Windows Azure blob storage
  • Running on the Windows Azure cloud
  • Implementing auto-save persistance with CouchDB
  • Adding support for authentication with everyauth and Windows Azure Access Control Service

Read more...
By Jose Romaniello
2012.04.10

Writing your first native module for node.js on Windows

In this article I will guide you on how to write a native module for node.js in Windows using Visual Studio.

Read more...
By Mariano Vazquez
2012.01.30

Browsing Blobs within a container using the Windows Azure Node SDK

The last couple of weeks we were working on a new, exciting project: a collaborative, real-time markdown editor that runs on a NodeJS server, hosted on Windows Azure (you'll hear more about this soon). One of the features that this app will have is the ability to store the .markdown files in either your local disk or Azure Blob Storage. To achieve this, we investigated the best way to list the containers and blobs of a specific account, and navigate them like we were dealing with an hierarchical structure. We found out that this can be done, but is not as easy and it sounds (you have to use a combination of the prefix and delimiter options of the listBlobs operation, along with inspecting the BlobPrefix element returned in the Blobs REST API response).

In the next lines, we are going to explain how you can implement this functionality in your application. We start from showing the blobs in a simple, flat-list to demonstrate how to organize them in a more complex structure, like if you were navigating your local file system directories.

To access blob storage, we used the Windows Azure SDK for Node.js (you can install this module in your node application by doing npm install azure). Also, don't forget to install the Windows Azure SDK for Node.js to emulate the Azure environment locally.

Read more...
By Matias Woloski
2012.01.19

Using Windows Azure Access Control Service (ACS) from a node express app

In this article we will explain how to use Windows Azure Access Control Service (ACS) from a node.js applicaiton. You might be wondering, what else Widows Azure ACS will provide that everyauth already does. Windows Azure ACS will provide single-sign-on to applications written in different languates/platforms and will also allow you to integrate with "enterprise Security Token Service" like Active Directory Federaetion Services (ADFS), SiteMinder or PingFederate, a common requirement for Software as a Service applications targeted to enterprise customers.

To do the integration we decided to extend everyauth which provided a good infrastructure to base our work on.

If you want to know how it works and how it was implemented read Implementing Windows Azure ACS with everyauth

If you want to know how to use Windows Azure ACS in your node app keep reading.

Read more...
By Dario Renzulli
2012.01.19

Implementing Windows Azure ACS with everyauth

In this article we will walk you through the implementation of the Windows Azure ACS module for everyauth.

Read more...
By Mariano Vazquez
2012.01.18

Running Mongodb on Azure and connect from a node web app

This post explains how to use MongoDB Replica Sets from a node.js app, all hosted on Windows Azure. For this, we'll use the new Windows Azure tools for MongoDB and Node.js, which contains some useful PowerShell CmdLets that will save valuable time.

We will also explain how the integration between mongo-node-azure works.

Read more...
By Juan Pablo Garcia
2012.01.11

Using the Windows Azure SDK for Node.js on Heroku

Getting the Windows Azure SDK for Noje.js running on Heroku wasn't as easy as we thought, in this article we're going to show you how we can workaround the Heroku limitation and how to create a simple application that leverages the SDK for listing blob containers.

Read more...
By Mariano Vazquez
2012.01.10

Running socket.io on Windows Azure Web and Worker roles

In this article, we are going to review how to configure a Node.js + socket.io server both inside a web and a worker roles (if you are not familiar with what a web and worker role is, read the following MSDN article).

Both approaches work with nearly the same code (with a minor tweak to disable WebSockets in Web roles), which leads the decision on what to choose depending solely on your own requirements and needs.

You start from the basic 'Hello World' template created by the Windows Azure Powershell for Node.js cmdlets to develop both roles, with the proper modifications to send messages via socket.io. We have created a client application you can use to test that everything is in place; it simply opens a connection to the server (either a Web or a Worker role) and shows the messages it receives.

Read more...
By Matias Woloski
2012.01.10

Hosting multiple node applications in the same Windows Azure role instance

One of the good things about Windows Azure is that a web role is a full VM (extra-small, small, medium, large or xl) just for you. You can even do remote desktop to it. So what's interesting about that? That you can host multiple websites in the same IIS, hence save some $$ and make good use of the virtual machine resources.

Declaring multiple web sites in your ServiceDefinition.csdef file is supported since 1.3 version. Wade Wegner has a nice post that explains how to make use of that feature within the context of ASP.NET web roles. However, the current version of the Windows Azure SDK for Node.js does not support running multiple node apps in the same instance. So in this article, we will explain how to deploy multiple node.js applications to the same Windows Azure role/VM and get the most out of your money.

Read more...
By Mariano Vazquez
2012.01.06

Accessing Azure Role Environment information from NodeJS

One of the things you may want to do while working on Azure is to obtain information about your role environment. The current role instance name, the DeploymentID or even know if the role instance is running or not. This can be tricky if you use NodeJS, because the RoleEnvironment class is managed .net code. In this article we'll going to explain how you can set up information of your running Azure role to be easily accessed from a NodeJS server. The trick is using environment variables and use startup tasks running PowerShell as the bridge.

I've created this sample that shows everything so you can test this yourself. Basically, it contains a startup task that dumps the Azure role environment info into Environment variables and a server.js file to outputs those variables. Anyway, in the next few lines you can read a deeper explanation about how to do it.

Read more...
By Matias Woloski
2012.01.06

Running wheat git-based blog engine on Windows Azure

In this article I will go through the details of setting up a blog on top of wheat and run it on Windows Azure.

  1. How wheat works
  2. Bootstrapping from an existing blog
  3. Run it on the Windows Azure emulator
  4. Deploy it to Azure
  5. Setting up the hook

Read more...
By Matias Woloski
2012.01.03

Windows Azure Startup task to run npm install to avoid deploying node modules

Deploying to Windows Azure is a lengthy task (scottgu are you listening?) and you don't want to make it even slower by uploading a package with all the node modules inside. Last week while talking to Johnny we were wondering why Azure is not doing npm install and reading the package.json by default.

It turns out that there is a heated debate apparentely in the node community about whether or not pushing node_modules to the source control is a good idea. My take is: if you wire up your dependencies against fixed versions (instead of latest or greater than) you are safe. So if you think the same, this is a small tutorial of how to configure an Azure role to do the magic. I took many interesting snippets from the great Steve Marx blog.

Read more...