Posts Tagged ‘Websites’

Node.js running on Azure.

Tuesday, September 10th, 2013

Recently I created a little node.js project for fun. It sole reason for existing is to display Bastard Operator from Hell quotes. I ended up deploying this little project to a free azure website because this little project used edge.js and required C#. Azure websites runs on windows and has .NET installed. Yes even node.js websites run on windows.

Time to jump right into it. I spent entirely too much time getting my little project deployed. Why? Well, the documentation for azure is incomplete. Little did I know, I was missing a key piece of info. To run node.js in azure, one needs a web.config file. If you use one of the templates it will be created for you. If you don’t use a template, you have to created. This is/was not documented.

Why does node.js require a web.config to run in azure? Well node.js in azure runs on IIS. Yeah, that IIS. If I am not mistaken, it is using iisnode. Honestly, this is ok given that azure runs windows and IIS is pretty decent at managing resources. But for the love of sanity, could this be written somewhere please?

How did I figure this out? By luck. I created another website using the template, FTPed into website and noticed a little file with the name web.config. Upon looking at, it is clear as to why it is required.

Here is an example of a web.config, the important piece is line 14. The path should be the name of app start js file.

     This configuration file is required if iisnode is used to run node processes behind
     IIS or IIS Express.  For more information, visit:


            <!-- indicates that the app.js file is a node.js application to be handled by the iisnode module -->
            <add name="iisnode" path="server.js" verb="*" modules="iisnode" />

                <!-- Don't interfere with requests for logs -->
                <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
                    <match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$" />

                <!-- Don't interfere with requests for node-inspector debugging -->
                <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
                    <match url="^server.js\/debug[\/]?" />

                <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
                <rule name="StaticContent">
                    <action type="Rewrite" url="public{REQUEST_URI}" />

                <!-- All other URLs are mapped to the Node.js application entry point -->
                <rule name="DynamicContent">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
                    <action type="Rewrite" url="server.js" />

        <!-- You can control how Node is hosted within IIS using the following options -->


My little project:
It running in azure:

Update 9/11/2013: I need to clear some things up. As pointed out in the comments there are many ways for azure to auto create a web.config or iisnode.yml file. In my case, I did not use the command line to deployment and ran into a bug with github deployments which would not allow me to publish to azure from github. This bug may be fixed now. In the end, I uploaded my files to azure via FTP, which did not create a file for me. My fun ensued at this point when I couldn’t figure why nothing was happening.

This was not meant as a bash against Azure. I was just putting this out there in case someone else runs into the same issue. Happy Coding!


Stack Overflow is programmer crack!

Sunday, March 29th, 2009

Stack Overflow is a Q&A wiki site for programmers. People can post questions, answer questions, and search for questions. Question and Answers get voted up or down based on what the community thinks of them. As people ask and answer questions, karma is gained. As karma is gained by a user they can do more on the site like editing, voting Cuarzo up, and voting down.

The site is the fairly popular among developers. The 100,000 question was recently asked with many added everyday. The community looks to 調布飛行場での開発拠点の確保 be pretty strong and oddly mature. I say oddly mature because it is the Internet after all.

Stack Overflow is programmer crack. I find myself setting at the questions wholesale jerseys page hitting refresh over and over again waiting for new questions to be asked. Its fun to see what roadblocks Is other programmers are Warrior stack at. It is also a good feeling to get voted up on question and/or answers on the site. The ultimate joy is when your question is Hello accepted as the answer. It some how validates you as a programmer when one of your questions get marked as an  answer or is up voted. Stack Overflow addicting nature is what keeps me coming back day after day to see what has been posted.

Stack Overflow is currently working out great for many people. Questions (depending on wholesale nba jerseys complexity) will have answers or suggestions shortly after posting because the community seems eager to help. And yes the answers are cheap mlb jerseys normally helpful in someway, shape, or form. In the end Stack Overflow comes highly recommended from this developer.