How to Setup HTTPS Locally with create-react-app

Veröffentlicht am: 07 August 2020
auf dem Kanal: How4Pc mac10
52
0

Text Source

#CREATE-REACT-APP #WITH #LOCALLY #HTTPS #SETUP #HOW

How to Setup HTTPS Locally with create-react-app

Running HTTPS in development is helpful when you need to consume an API that is also serving requests via HTTPS.

In this article, we will be setting up HTTPS in development for our create-react-app with our own SSL certificate.

At this stage, you're already set to go with https. But you don't have a valid certificate, so your connection is assumed to be insecure.

mkcert -install After running the above commands, you'll have created a certificate authority on your machine which enables you to generate certificates for all of your future projects.

mkcert -key-file ./.cert/key.pem -cert-file ./.cert/cert.pem "localhost" We'll be storing our generated certificates in the .cert directory. These should not be committed to version control, so you should update your .gitignore to include the .cert directory.

"start": "HTTPS=true SSL_CRT_FILE=./.cert/cert.pem SSL_KEY_FILE=./.cert/key.pem react-scripts start",

Don't be a stranger! Feel free to write if you have any questions - connect with me on Linkedin or follow me on Twitter.

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as


Auf dieser Seite können Sie das Online-Video How to Setup HTTPS Locally with create-react-app mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer How4Pc mac10 07 August 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 52 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!