In our development environment we have our Angular app running on a Mac in development mode (grunt serve) From a browser on the Mac we can access it with http://localhost:9000/
How can we access it from IE on a VirtualBox?
We are using yo angular generator Gruntfile.js
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
UPDATE:
The VirtualBox is installed, with Windows and IE, on the same Mac where I "grunt serve" and develop the Angular app
I can access the angular app from IE within VBox using URL: http://10.0.2.2 But something is still not working
1) In the Network panel
request.Name: livereload.js?snipver=1
request.Path: http://10.0.2.2:35729/
request.Protocol: pending
request.Status (Description): pending
2) In the Network panel there are no XHR requests listed
Maybe the problem is that the app is using REST endpoints which are on another server which is accessed through VPN ?
SOLVED:
The problem was not with V-Box network setup but with the way I was detecting localhost in the angular app (for DEV purposes)
I had:
var IS_LOCALHOST = (location.hostname.indexOf('localhost') > -1)
I changed it to
var IS_LOCALHOST = (location.hostname.indexOf('localhost') > -1) || (location.hostname.indexOf('10.0.2.2') > -1);
I use it for things like
var BASE_URL = IS_LOCALHOST ? 'http://dev.api.base.url' : 'http://' + location.hostname;