I am running an express.js application with iisnode as a handler.
Whenever I restart the site in IIS or process the application pool (manually or save the network configuration after changing the file), the application crashes with an error of 500.1001, but only on the first request. If after that the same route or any other route is requested, the application works fine.
I have this code at the entry point index.js
var server = app.listen(process.env.PORT, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
which registers undefined for the host, port on first request, but I have no idea why!
Details of the error:
- Iisnode module
- ExecuteRequestHandler notification
- Iisnode handler
- Error Code 0x00000002
- Requested URL (application entry point URL)
- ( )