none
[Node.js][Web Apps] Node.js express website not running Azure RRS feed

  • Question

  • Hi,

    I'm very new to Node.js and Azure. I managed to put a very simple express website and successfully deployed on Azure. Website runs locally on port 3000. However, when deployed to azure site doesn't render. Not sure what's going wrong. Code for server.js is as below

    var express = require('express');
    var app = express();
    var path = require("path");

    console.log(__dirname);

    app.use(express.static('public'));

    app.get('/', function (req, res) {
      res.sendFile(path.join(__dirname+'/index.html'));
    });

    app.get('/contact', function (req, res) {
      res.sendFile(path.join(__dirname+'/contact.html'));
    });

    app.listen(3000, function () {
      console.log('Example app listening on port 3000!');
    });

    I'm using Australia south east region and on shared resources plan. Am I missing something?

    Thanks




    Tuesday, April 26, 2016 1:45 PM

Answers