Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1501

how do i start a react web with https in localhost

$
0
0

I'm working on a react app where the app needs to open on https://localhost:300 but its opening on http://localhost:3000.I'm using windows OS and to make the app work i did the following

  1. generated the self signed certificate

  2. added it to the root level of the project

  3. my package json has

    "start": "set HTTPS=true && set REACT_APP_GIT_VERSION=$(git rev-parse head) && react-scripts start","safeStart": "export HTTPS=true&&SSL_CRT_FILE=cert.pem&&SSL_KEY_FILE=key.pem react-scripts start",

  4. when i try to run the app by using npm start or set HTTPS=true&&npm start the app is up and opening in the broswer but served on http but not on https.

  5. when i try to run the app using the npm safeStart or set HTTPS=true&&npm safeStart, i'm getting error at SSL saying its not configured.

I'm not sure if i'm missing something or i need to add some additional configs or so.


Viewing all articles
Browse latest Browse all 1501

Trending Articles