{"action":"opened","issue":{"url":"https://api.github.com/repos/tjanczuk/iisnode/issues/637","repository_url":"https://api.github.com/repos/tjanczuk/iisnode","labels_url":"https://api.github.com/repos/tjanczuk/iisnode/issues/637/labels{/name}","comments_url":"https://api.github.com/repos/tjanczuk/iisnode/issues/637/comments","events_url":"https://api.github.com/repos/tjanczuk/iisnode/issues/637/events","html_url":"https://github.com/tjanczuk/iisnode/issues/637","id":332972660,"node_id":"MDU6SXNzdWUzMzI5NzI2NjA=","number":637,"title":"raiseUrlNotFoundError when trying to deploy loopback application using iisnode in a windows machine(iis)","user":{"login":"gitinnolat","id":14094573,"node_id":"MDQ6VXNlcjE0MDk0NTcz","avatar_url":"https://avatars3.githubusercontent.com/u/14094573?v=4","gravatar_id":"","url":"https://api.github.com/users/gitinnolat","html_url":"https://github.com/gitinnolat","followers_url":"https://api.github.com/users/gitinnolat/followers","following_url":"https://api.github.com/users/gitinnolat/following{/other_user}","gists_url":"https://api.github.com/users/gitinnolat/gists{/gist_id}","starred_url":"https://api.github.com/users/gitinnolat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitinnolat/subscriptions","organizations_url":"https://api.github.com/users/gitinnolat/orgs","repos_url":"https://api.github.com/users/gitinnolat/repos","events_url":"https://api.github.com/users/gitinnolat/events{/privacy}","received_events_url":"https://api.github.com/users/gitinnolat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-16T08:53:30Z","updated_at":"2018-06-16T08:53:30Z","closed_at":null,"author_association":"NONE","body":"1. Scaffold app using slc loopback, which works fine if i do node . from command prompt.\r\n\r\n2. Went ahead and created an application on IIS and pointed it to the folder for app. Installed iisnode and urlrewrite module.\r\n\r\n3. created a app.js file outside server folder with below code:\r\nvar app = require('./server/server.js');\r\napp.start();\r\n\r\n4. Created a web.config, which looks like below:\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!--\r\n     This configuration file is required if iisnode is used to run node processes behind\r\n     IIS or IIS Express.  For more information, visit:\r\n\r\n     https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config\r\n-->\r\n\r\n<configuration>\r\n  <system.webServer>\r\n    <!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->\r\n    <webSocket enabled=\"false\" />\r\n    <handlers>\r\n      <!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->\r\n      <add name=\"iisnode\" path=\"index.js\" verb=\"*\" modules=\"iisnode\"/>\r\n    </handlers>\r\n    <rewrite>\r\n      <rules>\r\n        <!-- Do not interfere with requests for node-inspector debugging -->\r\n        <rule name=\"NodeInspector\" patternSyntax=\"ECMAScript\" stopProcessing=\"true\">\r\n          <match url=\"^index.js\\/debug[\\/]?\" />\r\n        </rule>\r\n\r\n        <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->\r\n        <rule name=\"StaticContent\">\r\n          <action type=\"Rewrite\" url=\"public{REQUEST_URI}\"/>\r\n        </rule>\r\n\r\n        <!-- All other URLs are mapped to the node.js site entry point -->\r\n        <rule name=\"DynamicContent\">\r\n          <conditions>\r\n            <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"True\"/>\r\n          </conditions>\r\n          <action type=\"Rewrite\" url=\"index.js\"/>\r\n        </rule>\r\n      </rules>\r\n    </rewrite>\r\n    \r\n    <!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->\r\n    <security>\r\n      <requestFiltering>\r\n        <hiddenSegments>\r\n          <remove segment=\"bin\"/>\r\n        </hiddenSegments>\r\n      </requestFiltering>\r\n    </security>\r\n\r\n    <!-- Make sure error responses are left untouched -->\r\n    <httpErrors existingResponse=\"PassThrough\" />\r\n\r\n    <!--\r\n      You can control how Node is hosted within IIS using the following options:\r\n        * watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server\r\n        * node_env: will be propagated to node as NODE_ENV environment variable\r\n        * debuggingEnabled - controls whether the built-in debugger is enabled\r\n\r\n      See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options\r\n    -->\r\n    <!--<iisnode watchedFiles=\"web.config;*.js\"/>-->\r\n  </system.webServer>\r\n</configuration>\r\n\r\n**Now when i am trying to access the url in browser http://localhost/smsapi/. This gives me error:**\r\n\r\nError\r\n404 Cannot GET /smsapi/\r\nstatus: 404\r\nError: Cannot GET /smsapi/\r\nat raiseUrlNotFoundError (C:\\GitHub\\smsapi\\sms\\node_modules\\loopback\\server\\middleware\\url-not-found.js:21:17)\r\nat Layer.handle [as handle_request] (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\layer.js:95:5)\r\nat trim_prefix (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:317:13)\r\nat C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:284:7\r\nat Function.process_params (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:335:12)\r\nat next (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:275:10)\r\nat C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:635:15\r\nat next (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:260:14)\r\nat Function.handle (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:174:3)\r\nat router (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:47:12)\r\nat Layer.handle [as handle_request] (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\layer.js:95:5)\r\nat trim_prefix (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:317:13)\r\nat C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:284:7\r\nat Function.process_params (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:335:12)\r\nat next (C:\\GitHub\\smsapi\\sms\\node_modules\\express\\lib\\router\\index.js:275:10)\r\nat nosniff (C:\\GitHub\\smsapi\\sms\\node_modules\\dont-sniff-mimetype\\index.js:4:5)"}}
{"actor":{"display_login":"gitinnolat"}}