loading...

Discussion on: How to setup HTTPS locally with create-react-app

Collapse
thiagobraga profile image
Thiago Braga

I came here just to see if you would talk about mkcert lol how good 😊. It is a sensational tool.

About the variables passed in the command line, they can be defined in an .env file if you prefer, I have a CRA project that uses this format and works very well.

HTTPS=true
SSL_CRT_FILE=./.cert/cert.pem
SSL_KEY_FILE=./.cert/key.pem

Screenshot of CRA with .env and mkcert

Congratulations and thanks for the post. 👏

Collapse
ganeshagrawal profile image
Ganesh Agrawal Author

Yes, sure we can use env variable as env variable and set env variable as global to ignore the cert generation problem in every react project that we going to create in future and use that same certificate for multiple projects

Collapse
thiagobraga profile image
Thiago Braga

It's a great idea. Most of the projects we run on localhost, so it would work well to share the generated certificates between different projects.

Some comments have been hidden by the post's author - find out more