Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Issue in hosting nodejs website in IIS8 on windows 8

$
0
0

Hi,

I have hosted express nodejs website in IIS8 on wondows 8. But i am getting issue,

app.js script content:

var express = require('express');
var expApp = express();
var ipaddress = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1";
var port = process.env.OPENSHIFT_NODEJS_PORT || 5100;
var http = require('http');

http.createServer(expApp).listen(port, ipaddress, function () {
    console.log('Express app started ip:' + ipaddress + ':' + port);
});

expApp.use(function (req, res, next) {
    console.log('Time:', Date.now());
    next();
});

expApp.get('/', function (req, res) {
    res.send('Welcome!');
});

expApp.get('/index', function (req, res) {
    res.send('Welcome!!!!!!');
});

web.config content:

<configuration>
  <system.webServer>
    <defaultDocument enabled="true">
      <files>
        <add value="app.js" />
      </files>
    </defaultDocument>
    <handlers>
      <clear />
      <add name="iisnode" path="app.js" verb="*" modules="iisnode"/>
    </handlers>
    <security>
      <requestFiltering>
        <hiddenSegments>
          <add segment="node_modules" />
        </hiddenSegments>
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

Browsing Url: http://localhost:5100/

Error:

Application has thrown an uncaught exception and is terminated:
Error: listen EACCES 127.0.0.1:5100
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at Server._listen2 (net.js:1218:19)
    at listen (net.js:1267:10)
    at net.js:1376:9
    at doNTCallback3 (node.js:441:9)
    at process._tickCallback (node.js:347:17)
    at Function.Module.runMain (module.js:477:11)
    at startup (node.js:118:18)
    at node.js:952:3

Please let me know how to resolve this issue.


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>