Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View Gatsby dev site on multiple devices? #2837

Closed
ooloth opened this issue Nov 7, 2017 · 5 comments
Closed

View Gatsby dev site on multiple devices? #2837

ooloth opened this issue Nov 7, 2017 · 5 comments

Comments

@ooloth
Copy link
Contributor

ooloth commented Nov 7, 2017

I'm hoping to test my Gatsby site on multiple devices during development.

Following the advice of @webOS101 in #864, I ran gatsby develop --host <my-machine>.local (substituting <my-machine> for my actual computer name). Gatsby then said my site is running at http://localhost:8000/ (which it is not).

If this is the correct method, what URL do I open each device's browser to in order to view my dev site?

If this is the wrong method, what is the right way to view my Gatsby dev site on multiple devices?

@KyleAMathews
Copy link
Contributor

Looks like localhost got hardcoded:

`Your site is running at http://localhost:${program.port}`,

Interested in putting together a PR to use the actual host value?

@ooloth
Copy link
Contributor Author

ooloth commented Nov 8, 2017

I'd love to! But, I'm not sure how that line needs to change... 🤔

@JLongley
Copy link
Contributor

JLongley commented Nov 9, 2017

To be clear, that line you reference is just a log statement. The actual code DOES use the host value:

`${require.resolve(`webpack-hot-middleware/client`)}?path=http://${
program.host
}:${webpackPort}/__webpack_hmr&reload=true&overlay=false`,

You can achieve what you are trying to do with:

gatsby develop -H 0.0.0.0

@KyleAMathews
Copy link
Contributor

--host works too — so what @ooloth was doing worked it just was confusing due to the logging bug.

Thanks for the fix @JLongley!

@maximerabot
Copy link

Hi,

is it also possible to make the auto refresh work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants