4

I'm running a Node.js server as API for my mobile app on a Windows Azure Website. And I'm having some trouble with it due to the needed web.config - but I couldn't find any really helpful documentation about it. Everything I can find is googling for specific problems on it and with a bit luck I can use the config snippets.

  • is there any general documentation about the contents the web.config can contain and their meaning?
  • in the start I had the problem that errors were modified by IIS to a general error. But since it's a REST API I want the HTTP status codes to be returned. I got around that with the <httpErrors existingResponse="PassThrough" /> element, but it doesn't seem to work for every error.

The only documentation I found so far are example configuration files of the iisnode module.

akohout
  • 1,802
  • 3
  • 23
  • 42
  • 1
    Did you find an answer for this in the end? I'm getting "web.config not found in project, to create a project to deploy to Windows Azure you must create a Windows Azure Node.js project." when trying to deploy my node app to azure. I haven't found any documentation relating to this either. – James Dec 06 '13 at 09:21
  • 1
    No, I haven't found anything yet. I know some elements of the xml file a.k.a. web.config, but the separate parts of the web.config are distributed across the azure documentation. – akohout Dec 06 '13 at 09:41

2 Answers2

4

If you see the following error:

web.config not found in project, to create a project to deploy to Windows Azure you must create a Windows Azure Node.js project.

....you may have created the wrong type of Visual Studio Project. You want a "Windows Azure Node.js Application" not a "Node.js Web Application". The former creates a few extra files that are needed for Azure (Web.cloud.config & Web.config).

You may be able to create a dummy VS project of the correct type and then copy these files into your existing project. Alternatively create a new project of the correct type and copy your source files into the new project.

Lars
  • 9,976
  • 4
  • 34
  • 40
  • Ok, but why isn't there any documentation about the contained values of this config? I'll mark your comment as solution, since it's the only help so far one can get :-) – akohout Jan 10 '14 at 08:02
  • 1
    Agreed. I haven't been able to find detailed documentation either, only what can be found at [NodeJsTools](http://nodejstools.codeplex.com/). However, as the files are auto-generated hopefully you aren't blocked. The one thing that I've had to change is iisnode path. It defaults to "server.js" which you may not necessarily be using. – Lars Jan 10 '14 at 17:35
3

Create Azure Basic Node.js Express Application

Azure node application

Asim Nadeem
  • 141
  • 1
  • 3