DEV Community

Divyajyoti Ukirde
Divyajyoti Ukirde

Posted on

5 1

Get HTTPS support in just one line

In your react web app, if you need HTTPS support while running on your localhost, just add this in your start script in your package.json file.

{
  "start": "HTTPS=true react-scripts start"
}
Enter fullscreen mode Exit fullscreen mode

Then just run npm start.

You'll see something like this:
Not secured

But that's acceptable, till your site is getting served over HTTPS.

Bingo!
No need to take efforts of creating an SSL certificate!

Top comments (1)

Collapse
 
dance2die profile image
Sung M. Kim โ€ข

Thank you, Divyajyoti.
I didn't know about that flag~

Sentry image

See why 4M developers consider Sentry, โ€œnot bad.โ€

Fixing code doesnโ€™t have to be the worst part of your day. Learn how Sentry can help.

Learn more

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay