create-react-app: how to use https instead of http?

Ringo picture Ringo · Jun 15, 2017 · Viewed 78.7k times · Source

I was wondering if anyone knows how to use https on dev for the 'create-react-app' environment. I can't see anything about that in the README or quick googling. I just want either the https://localhost:3000 to work, or else https://localhost:3001.

Answer

Steve Buzonas picture Steve Buzonas · Jun 15, 2017

Set HTTPS=true before you run the start command.

Documentation

The implementation uses the HTTPS Environment Variable to determine which protocol to use when starting the server.