0

ISSUE #1

When I use http://127.0.0.1/mysite/node/server.js URL it shows me my test page, which is OK. But I expect it to show me the node-inspector based debug page when I use http://127.0.0.1/mysite/node/server.js/debug/ URL. However, this does not work and instead continues to show me the same sample page content.

What should I be doing for the debugger to work?

ISSUE #2

Also, I've noticed that when I go to this URL, it automatically gets redirected to

http: //127.0.0.1/mysite/ public/mysite/ node/server.js/debug/

Why is this happening? Can I avoid this redirection? If yes, how?

Web.config content

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />


<!-- Web.Debug.config adds attributes to this to enable remote debugging when publishing in Debug configuration. -->
<!--<iisnode watchedFiles="web.config;*.js"/>--> 

<!-- Remote debugging (Azure Website with git deploy): Comment out iisnode above, and uncomment iisnode below. -->
<iisnode watchedFiles="web.config;*.js"
  loggingEnabled="true"
  devErrorsEnabled="true"
  nodeProcessCommandLine="node.exe &#45;&#45;debug"/>

<!-- indicates that the server.js file is a Node.js application 
to be handled by the iisnode module -->
<handlers>
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

    <add name="iisnode" path="node/server.js" verb="*" modules="iisnode" />

    <!-- Remote debugging (Azure Website with git deploy): Uncomment NtvsDebugProxy handler below.
    Additionally copy Microsoft.NodejsTools.WebRole to 'bin' from the Remote Debug Proxy folder.-->
    <add name="NtvsDebugProxy" path="ntvs-debug-proxy/95a6beca-6da8-493c-b380-2822603aa5dc" verb="*" resourceType="Unspecified"
    type="Microsoft.NodejsTools.Debugger.WebSocketProxy, Microsoft.NodejsTools.WebRole"/>
</handlers>

<rewrite>
  <rules>
    <clear />

    <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$"/>
    </rule>

    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^server.js\/debug[\/]?" />
    </rule>

    <rule name="StaticContent">
      <action type="Rewrite" url="public{REQUEST_URI}"/>
    </rule>

    <rule name="DynamicContent">
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
      </conditions>
      <action type="Rewrite" url="node/server.js"/>
    </rule>

  </rules>
</rewrite>
<!-- <rewrite>
  <rules>
    <clear />
    <!- Remote debugging (Azure Website with git deploy): Uncomment the NtvsDebugProxy rule below. ->
    <!-<rule name="NtvsDebugProxy" enabled="true" stopProcessing="true">
      <match url="^ntvs-debug-proxy/.*"/>
    </rule>->
    <rule name="app" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="iisnode.+" negate="true" />
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
      <action type="Rewrite" url="server.js" />
    </rule>
  </rules>
</rewrite> -->
  </system.webServer>
Temp O'rary
  • 5,366
  • 13
  • 49
  • 109

1 Answers1

0

ISSUE #1

According to your description, it seems that you debug and test your project on your local host or Azure VM. In this situation, we should make sure IIS have installed the IISNode module firstly. So I recommend you can refer to this document to make sure you have installed IISNode successfully.
Secondly,we should check whether project included the your node-inspector configuration. Also you can use Node.js Sample to check whether your node-inspector is installed successfully. Thirdly, If you can not use this debugger, you can press "F12" to trace the debugger error in your Webkit enabled web browser. If you encountered the error, please share the error on forum and for further support.

ISSUE #2

For second issue, it seems that the URL rewrite Rule to lead to this wrong URL.

<rule name="StaticContent">
      <action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>

For example, if a request was made for this URL: "http://127.0.0.1/content/default.aspx?tabid=2&subtabid=3", so the REQUEST_URI server variable contains content/default.aspx?tabid=2&subtabid=3.

You can get the "http://127.0.0.1/public/content/default.aspx?tabid=2&subtabid=3" as the result. I suggest you can refer to this URL rewrite module for more details.

Will Shao - MSFT
  • 1,189
  • 7
  • 14