Skip to content

Using HTTPS in Create React App

Learn how to serve pages over HTTPS in Create React App development. After testing your application with http, you might want to serve your pages over HTTPS too. The following ways describe how to do it.

Setting environment variable

Set HTTPS environment variable using

export HTTPS=true

..and then start your application using..

npm start

Setting start script

..Or you can set it with your start script in package.json like..

"start": "export HTTPS=true&&PORT=3320 react-scripts start"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.