DEV Community

loading...

Get HTTPS support in just one line

Divyajyoti Ukirde
I'm currently 🌱 learning and πŸ”­ working on the Javascript Ecosystem. πŸ˜„ Pronouns: she/her ⚑ Fun fact: I have a Computer Engineering background but the most credit goes to Google and Stack Overflow
・1 min read

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"
}

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!

Discussion (1)

Collapse
dance2die profile image
Sung M. Kim

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