Skip to content

Commit ab41c4c

Browse files
TomasHubelbaueriansu
authored andcommitted
Document how to use the .env file to enforce HTTPS (#7821)
1 parent dc4d62d commit ab41c4c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docusaurus/docs/using-https-in-development.md

+11
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ HTTPS=true npm start
3131
```
3232

3333
Note that the server will use a self-signed certificate, so your web browser will almost definitely display a warning upon accessing the page.
34+
35+
To avoid having to set the environment variable each time, you can either include in the `npm start` script like so:
36+
37+
```json
38+
{
39+
"start": "HTTPS=true react-scripts start"
40+
}
41+
```
42+
43+
Or you can create a `.env` file with `HTTPS=true` set.
44+
[Learn more about environment variables in CRA](https://create-react-app.dev/docs/adding-custom-environment-variables).

0 commit comments

Comments
 (0)