Grunt server + Vagrant: Port forwarding & IPs
In your Vagrantfile...
Forward a port from your host machine to 8000 on the guest. 8000 is the default port the grunt server runs on.
config.vm.network "forwarded_port", guest: 8000, host: 8094
Forward port 35729 on your host to the guest. 35729 is the port used by livereload: https://github.com/gruntjs/grunt-contrib-watch#optionslivereload
config.vm.network "forwarded_port", guest: 35729, host: 35729
In your Gruntfile.js use the 0.0.0.0
IP address to allow access from the parent machine & local machine:
connect: {
options: {
hostname: '0.0.0.0'
},
},
Written by Steffan Harries
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Web
Authors
johnbender
77.84K
hector
56.62K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#