Gatsby: Gatsby develop on https

Created on 15 Oct 2017  Â·  8Comments  Â·  Source: gatsbyjs/gatsby

We are testing stripe integration on a site generated by gatsby. Because gatsby develop starts on http site, we cannot test stripe integration.

How can we configure gatsby develop to run on https mode? I see that webpack devserver has --https options but when I specified that in gatsby develop it errors out.

Most helpful comment

Happy to add support for using https w/ the develop server. FYI, we don't serve things directly from webpack-dev-server.

All 8 comments

While it's just a workaround, you could use something like ngrok to access gatsby server via https.

I tried ngrok. But I get these errors in the console when I access the site. Looks like some paths are not relative in the devmode, which is causing these issues.

Access to Font at 'http://localhost:8000/static/slick.d41f55a7.ttf' 
from origin 'http://55031aa2.ngrok.io' has been blocked by CORS 
policy: No 'Access-Control-Allow-Origin' header is present on the 
requested resource. Origin 'http://55031aa2.ngrok.io' is therefore not allowed access.

Happy to add support for using https w/ the develop server. FYI, we don't serve things directly from webpack-dev-server.

Thank you @KyleAMathews for going to add this and also clarifying webpack-dev-server is not used internally.

Oh, I should have proofed my comment better — I meant I'm happy to support someone else adding a PR to add support for this :-)

I don't have any current need for this so won't be doing it.

Can you please give some hints on how to approach adding https support?

All the develop server code is in https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/commands/develop.js

I'm not really sure what the best way to get https running automatically locally so you'll need to research that.

BTW, I also googled "stripe localhost" and it seems you don't need https when testing locally FWIW.

gatsby develop has https now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kalinchernev picture kalinchernev  Â·  3Comments

hobochild picture hobochild  Â·  3Comments

totsteps picture totsteps  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments

rossPatton picture rossPatton  Â·  3Comments