0

I'm running grunt/node/famo.us for a demo app on my Windows dev box. Everything works fine on that machine when I go to localhost:1377 using Chrome. Now I am trying to access the site from my other box on the same network using ipaddress:1377 but Chrome says it can't find it. I have totally disabled Windows Firewall but it still won't come up. Is remote calling a grunt site supported? Am I doing something else wrong?

Here is my gruntfile.js:

/*global module:false*/

/*Generated initially from grunt-init, heavily inspired by yo webapp*/

module.exports = function(grunt) {
  'use strict';

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Load grunt config
  require('load-grunt-config')(grunt, {
    init: true,
    data: {
      config: {
        // Configurable paths
        app: 'app',
        dist: 'dist'
      }
    }
  });
};
skb
  • 30,624
  • 33
  • 94
  • 146

2 Answers2

1

Yes, remote calling is supported. Go into Gruntfile.js and change the grunt.initConfig connect options to the following..

grunt.initConfig({
    // .. Some config
    // ..
    connect: {
        options: {
            port: grunt.option('port') || 5555,
            livereload: 35729,
            // Change this to '0.0.0.0' to access the server from outside
            hostname: '0.0.0.0'
        },
        // Other Options..
        // ..
    },
    // .. More Config
    // ..
}

Hope this helps!

EDIT: Ok try this then..

/*global module:false*/

/*Generated initially from grunt-init, heavily inspired by yo webapp*/

module.exports = function(grunt) {
  'use strict';

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Load grunt config
  require('load-grunt-config')(grunt, {
    init: true,
    data: {
      config: {
        // Configurable paths
        app: 'app',
        dist: 'dist'
      },
      connect: {
          options: {
              port: grunt.option('port') || 5555,
              livereload: 35729,
              // Change this to '0.0.0.0' to access the server from outside
              hostname: '0.0.0.0'
          },
          livereload: {
              options: {
                  open: true,
                  base: [
                      '.tmp',
                      '<%= config.app %>'
                  ]
              }
          },
          dist: {
              options: {
                  open: true,
                  base: '<%= config.dist %>',
                  livereload: false
              }
          }
      }
    }
  });
};
johntraver
  • 3,612
  • 18
  • 17
  • I've added my grunt config file to the question because I don't see where I would put what you're showing. Thanks! – skb May 17 '14 at 03:34
  • Ok.. I added the entire contents of my 'connect' config to your gruntfile.js – johntraver May 17 '14 at 04:05
0

In your grunt file connect options, try omitting the hostname field entirely. In the past I've encountered issues with both Express and Connect where defining the hostname actually caused the server to only be reachable by that hostname (e.g. 0.0.0.0, 127.0.0.1 and localhost), but not the NAT IP (e.g. 192.68.x.x or 10.0.x.x). I don't understand why this is so, but something worth trying.

Andrew De Andrade
  • 3,606
  • 5
  • 32
  • 37