Reputation: 15321
I'm wanting to view my SPA on a few different devices on my network, so in my Grunt file I changed the hostname
to '0.0.0.0' as Grunt instructs, my connect task/object now looks like this:
// The actual grunt server settings
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0',
livereload: 35729
},
Now when I run grunt serve
the app opens the browser at http://0.0.0.0:9000/
however my application isn't shown, I am given the following Error:
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: "http://0.0.0.0:9000/"
Access Denied.
Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.
Does anyone have any ideas on what I should do to fix this issue. I have tried using hostname: '*'
but that doesn't do anything but how the same error.
I am developing on OS X 10.9.2
Thanks in advance
Upvotes: 1
Views: 2201
Reputation: 495
You can set your own ip address instead of the 0.0.0.0
.
With this grunt launch the server on your ip. You can use your mobile to.
The livereload will work on your desktop and on your mobile.
It's not the best way if your work by team because each one have his ip address but it's good enough if you work alone.
Upvotes: 0
Reputation: 1331
Setting hostname to '0.0.0.0' is correct. You can connect to your server by connecting to http://localhost:9000
. Alternatively, you can use the output of hostname
to connect with the machine. Optionally, you should also set the baseUrl variable in your tests to connect to
Upvotes: 2
Reputation: 107
I have the same problem. It seems that the '0.0.0.0' setting allows you to call your site from outside your computer; but screws the call to the web browser asking it to load a page located in an invalid server "http: / / 0.0.0.0"
If you replace the address to the right server name instead of 0.0.0.0 it will work.
Upvotes: 0