I was wondering if anyone knows how to use https on dev for the \'create-react-app\' environment. I can\'t see anything about that in the README or quick googling. I just wa
set HTTPS=true&&npm start
(Note: the lack of whitespace is intentional.)
($env:HTTPS = "true") -and (npm start)
HTTPS=true npm start
Note that the server will use a self-signed certificate, so your web browser will almost definitely display a warning upon accessing the page.
HTTPS=true SSL_CRT_FILE=<SSLCert.crt> SSL_KEY_FILE=<SSLCert.key> npm start
HTTPS=true SSL_CRT_FILE=<SSLCert.crt> SSL_KEY_FILE=<SSLCert.key> npm start
To avoid doing it each time: You can include in the npm start script like so:
{
"start": "HTTPS=true react-scripts start"
}
Or you can create a .env file with HTTPS=true