iisnode

process.env.PORT is undefined

回眸只為那壹抹淺笑 提交于 2019-12-11 00:44:07
问题 I am trying to go to production on one of my node.js applications which runs ion windows server 2012. After a week of troubleshooting and reading everything I could get to online, the problem seems to be the "process.env.PORT" variable. The symptoms are as follows: The website works fine when: set PORT=3510 in console domain.com:3510/index.html in remote browser However, when I type: domain.com I get a 404 - File or directory not found. When I console.log the "process.env" object at startup

Port being undefined in the Azure Node.js application running on IISNode

僤鯓⒐⒋嵵緔 提交于 2019-12-10 22:29:36
问题 I have an Azure App Service running Node.js application using IISNode. The problem is that process.env.PORT is undefined. I have read that IISNode uses a thing called named pipes and that the port information might not be easily readable (?), but in my case I only get undefined. The project I try to deploy can be found from GitHub. I do have a Web.config file defined and it looks like this: <handlers> <!-- indicates that the app.js file is a node.js application to be handled by the iisnode

Access web.config settings from iisnode?

喜你入骨 提交于 2019-12-10 01:59:08
问题 If I add settings to my app's web.config file, is there an API to read the settings from my app or do I have to read the file using an XML library? 回答1: There is no special API that allows you read web.config into your node.js application running in iisnode. Having said that: all key/value pairs from the appSettings section in web.config will be promoted to environment variables of the node.exe process, so you can access them using process.env, as of iisnode v0.1.19, in addition to web.config

IISNode debugger: Error during WebSocket handshake: Unexpected response code: 200

拈花ヽ惹草 提交于 2019-12-08 03:39:59
问题 I've been having trouble getting the IISNode debugger to work with my project. I figured I'd start by getting it working with the example projects first but I'm still not having any luck. Using IISNode 0.2.21 and node.js 8.11.2 with IIS 10.0.14393.0 . When I try to open the debugger the entire process takes around 3 minutes and eventually fails with " WebSocket connection to 'ws://localhost/node/configuration/hello.js/debug/ws' failed: Error during WebSocket handshake: Unexpected response

How to setup iisnode with express?

帅比萌擦擦* 提交于 2019-12-05 10:59:46
问题 I recently started working on nodejs. I created a simple nodejs api (with express) which connect to SQL server database and return result. After my development I had challenge how to host this node js api. I decided to host my api on IIS. I got different errors and in the end I was able to make it work. Thanks to different articles on internet. Below are the steps I followed. May be this can help anyone who is new and trying to host nodejs in windows IIS. 回答1: I recently started working on

Access web.config settings from iisnode?

徘徊边缘 提交于 2019-12-05 01:32:47
If I add settings to my app's web.config file, is there an API to read the settings from my app or do I have to read the file using an XML library? Tomasz Janczuk There is no special API that allows you read web.config into your node.js application running in iisnode. Having said that: all key/value pairs from the appSettings section in web.config will be promoted to environment variables of the node.exe process, so you can access them using process.env, as of iisnode v0.1.19, in addition to web.config, configuration settings can be specified in a iisnode.yml file; see http://tomasz.janczuk

IISNode periodically fails with HTTP 500.1001 on Azure

家住魔仙堡 提交于 2019-12-04 11:25:54
The site periodically becomes unavailable with HTTP 500 error. All I could find from the logs so far is: ModuleName iisnode Notification EXECUTE_REQUEST_HANDLER HttpStatus 500 HttpReason Internal Server Error HttpSubStatus 1001 ErrorCode The system cannot find the file specified. (0x2) Note that response time in this instance is around 38 seconds. I suspect this happens because IISNode process goes to sleep and the when it wakes up it fails on the first request after long time out. I created Azure WebJob that pings the site every 15 minutes to keep it alive and it seemed resolved the issue. I

iisnode and express

邮差的信 提交于 2019-12-04 10:09:44
I'm sure this question has been asked a million times but I've not found any solution to the following problem as of yet. I have a basic application running using nodejs and express. When I run the application in node, it by default sends me to the index.html in my public folder. Even if I don't have any routes set up. I want this to happen. I've installed iisnode and created a new application under 'Default Website' called 'Devices'. I put my application in there unchanged. Reading around I needed to sort some stuff out with the web.config and decided to go with the config mentioned here (not

IIS returns 500 when Node app returns a 4xx

点点圈 提交于 2019-12-04 08:50:11
I have also asked this on the iisnode github project I am using IISNode via a Windows Azure Website. If my Node app returns a 2xx status code (200, 201, etc), then all is well and works as expected. if my Node app returns a 4xx status code, for example: response.send(404, "not found") (I am using Restify) then I get a 500 sent to the client and the body is simply "The page cannot be displayed because an internal server error has occurred." If I do azure site log tail <sitename> , then when the 500 gets sent to the client, the log contains HTML of a 404. ... <body> <div id="content"> <div class

How to setup iisnode with express?

人走茶凉 提交于 2019-12-03 21:50:55
I recently started working on nodejs. I created a simple nodejs api (with express) which connect to SQL server database and return result. After my development I had challenge how to host this node js api. I decided to host my api on IIS. I got different errors and in the end I was able to make it work. Thanks to different articles on internet. Below are the steps I followed. May be this can help anyone who is new and trying to host nodejs in windows IIS. I recently started working on nodejs. I created a simple nodejs api (with express) which connect to SQL server database and return result.