With most development servers I can use my phone to visit my computer’s IP address and the server’s port (10.0.0.9:1313 for example) and the site will load on my phone. This doesn’t seem to work with the hugo server.
I am currently working on my theme and it would be helpful to preview on an actual phone. Is there any way around this?
EDIT: I changed the title since ‘Hugo server only serves to local machine’ makes it sound like it’s doing exactly what its supposed to. ‘Hugo only serves to host computer’ describes my problem much better.
@Matt_O_Tousa I don’t have time to test right now, but I seem to recall testing this at home on wifi without issue.
That said, if you’re just starting on your theme and don’t have your own build process completely set in stone, I’d recommend looking at Victor Hugo as a sort of starter kit. If nothing else, it has browsersync baked right in…which gives you the accessible server from your phone plus livereload across the multiple devices…
Hi @Matt_O_Tousa, is your phone in the same IP segment as your local machine? When I’m going to publish I always do it, but the has to be able to see the local machine.
@RickCogley Currently my phone is at 10.0.0.3 and my computer is at 10.0.0.9.
@bep That almost works - my phone will load the HTML but it looks like all the {{ .Site.BaseURL }} tags are still being filled in with localhost, so my CSS and my article links are dead. This is strange, my computer is 10.0.0.9 anyway.
Actually it works great: hugo server --bind=0.0.0.0 --baseURL=http://0.0.0.0:1313
Let’s say that I executed the above command from a Virtual Machine that has an IP address of 192.168.1.6
Now when I visit http://192.168.1.6:1313/ on any any device that is connected on my network I get the website that I currently work on served by the Hugo Local Server with instant changes!