title: cannot start nodejs web api hosted in Azure
body: <p>Learning <code>nodejs</code> and started to created my own restful API using restify.</p>
  
  <p>I have created a very simple <code>server.js</code> file which contains basically a hello world type example starting up like: </p>
  
  <pre><code>server.post('/api/messages', servicemanager.verifyFramework(), servicemanager.listen());
  
  server.get(/.*/, restify.serveStatic({
      'directory': '.',
      'default': 'index.html'
  }));
  
  server.listen(process.env.port || 3978, function () {
      console.log('%s listening to %s', server.name, server.url); 
  });
  </code></pre>
  
  <p>which works fine locally. I cant hit <a href="http://localhost:3978" rel="nofollow">http://localhost:3978</a> and I can test my API calls just fine calling <a href="http://localhost:3978/api/messages" rel="nofollow">http://localhost:3978/api/messages</a>.</p>
  
  <p>I have deployed my code into bitbucket and now I want to host these APIs in Azure using <code>App Services</code>.</p>
  
  <p>My project structure is like so:</p>
  
  <pre><code>/topfolder
    -/myproject
       -/node_modules
         -/node_modules...
       server.js
       package.json
       index.html
  </code></pre>
  
  <p>When I setup the new app service in Azure, I can see that the deployment receives the code from BB, but the service never responds to my requests.</p>
  
  <p>I have setup the home path of the app to live in: <code>/site/wwwroot/topfolder/myproject</code> and I can see the <code>index.html</code> when I navigate to <a href="http://myproject.azurewebsites.net" rel="nofollow">http://myproject.azurewebsites.net</a> so thats good.</p>
  
  <p>I actually get a 404 error: 
  <code>The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.</code></p>
  
  <p>There are heaps of examples of how to setup continuous deployment using bitbucket and for the most part, they all seem to work, but my <code>server.js</code> file doesnt seem to be the getting called or starting up.</p>
  
  <p>How can I debug whats going on here?</p>
  
  <p>Is the <code>packages.json</code> file used in this scenario by Azure?</p>
  
  <p>Thanks.</p>