From 76349c8e19cfe569a922d422e7d60fd3aca880d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20H=C3=BCbelbauer?= Date: Sun, 13 Oct 2019 20:25:29 +0200 Subject: [PATCH] Document how to use the .env file to enforce HTTPS --- docusaurus/docs/using-https-in-development.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docusaurus/docs/using-https-in-development.md b/docusaurus/docs/using-https-in-development.md index 4dbb2536d70..3541e356b8e 100644 --- a/docusaurus/docs/using-https-in-development.md +++ b/docusaurus/docs/using-https-in-development.md @@ -31,3 +31,14 @@ 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. + +To avoid having to set the environment variable each time, you can either include in the `npm start` script like so: + +```json +{ + "start": "HTTPS=true react-scripts start" +} +``` + +Or you can create a `.env` file with `HTTPS=true` set. +[Learn more about environment variables in CRA](https://create-react-app.dev/docs/adding-custom-environment-variables).