0

I'm trying to deploy my nodejs rest api application to my azure cloud, but i fail again and again.

I get HTTP 500 response.

"The page cannot be displayed because an internal server error has occurred."

My AZURE FTP (What I Uploaded) :

enter image description here

web.config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <webSocket enabled="false" />
    <handlers>
      <add name="iisnode"
           path="app.js"
           verb="*"
           modules="iisnode"/>
    </handlers>
    <rewrite>
      <rules>
        <rule name="NodeInspector"
              patternSyntax="ECMAScript"
              stopProcessing="true">
          <match url="^app.js\/debug[\/]?" />
        </rule>
        <rule name="DynamicContent">
          <conditions>
            <add input="{REQUEST_FILENAME}"
                 matchType="IsFile"
                 negate="True"/>
          </conditions>
          <action type="Rewrite" url="app.js"/>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

URLs

Request : localhost/api/user/getcategories/5c141fa7498f3605c8b2cf34

Response :

{
    "success": true,
    "categories": [
        {
            "_id": "5c141fab498f3605c8b2cf35",
            "name": "OTHER"
        }
    ]
}

Request : https://**.azurewebsites.net/api/user/getcategories/5c141fa7498f3605c8b2cf34

Response : The page cannot be displayed because an internal server error has occurred.

1
  • I solved this problem by adding NodeJS version to 'Application Settings' panel. WEBSITE_NODE_DEFAULT_VERSION, 8.9.4 Commented Dec 22, 2018 at 22:13

1 Answer 1

1

If you access your Azure App Service pane for the web app, under Development Tools you should have a "Advanced Tools". Select it and then hit "go" to access Kudu.

Kudu Advanced Tools Screenshot

You can then go to the "Debug Console" dropdown to access your preferred shell. From here you should be able to access the server logs and see what errors are being thrown.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.