- react-scripts v4.0.0 or above follow https://create-react-app.dev/docs/using-https-in-development/
dotnet dev-certs https --format PEM -np -ep '<filepath-with-pem-extensions>'
# example: dotnet dev-certs https --format PEM -np -ep D:\ssl\localhost.pem
Note: with -np parameter (mean no-password in dev-certs tool) will export 2 file localhost.pem
and localhost.key
like above exam
Create .env
at root react project
HTTPS="true"
SSL_KEY_FILE="<path-to-keyfile>/localhost.key"
SSL_CRT_FILE="<path-to-cert-file>/localhost.pem"
Run project
yarn start
or
react-scripts start