diff --git a/docusaurus/docs/user-guide.md b/docusaurus/docs/user-guide.md index 72971545..cded6bb9 100644 --- a/docusaurus/docs/user-guide.md +++ b/docusaurus/docs/user-guide.md @@ -11,7 +11,6 @@ You can find the most recent version of this guide [here](https://github.com/fac ## Table of Contents -- [Using HTTPS in Development](#using-https-in-development) - [Generating Dynamic `` Tags on the Server](#generating-dynamic-meta-tags-on-the-server) - [Pre-Rendering into Static HTML Files](#pre-rendering-into-static-html-files) - [Injecting Data from the Server into the Page](#injecting-data-from-the-server-into-the-page) @@ -22,36 +21,6 @@ You can find the most recent version of this guide [here](https://github.com/fac - [Advanced Configuration](#advanced-configuration) - [Alternatives to Ejecting](#alternatives-to-ejecting) -## Using HTTPS in Development - -> Note: this feature is available with `react-scripts@0.4.0` and higher. - -You may require the dev server to serve pages over HTTPS. One particular case where this could be useful is when using [the "proxy" feature](#proxying-api-requests-in-development) to proxy requests to an API server when that API server is itself serving HTTPS. - -To do this, set the `HTTPS` environment variable to `true`, then start the dev server as usual with `npm start`: - -#### Windows (cmd.exe) - -```cmd -set HTTPS=true&&npm start -``` - -(Note: the lack of whitespace is intentional.) - -#### Windows (Powershell) - -```Powershell -($env:HTTPS = $true) -and (npm start) -``` - -#### Linux, macOS (Bash) - -```bash -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. - ## Generating Dynamic `` Tags on the Server Since Create React App doesn’t support server rendering, you might be wondering how to make `` tags dynamic and reflect the current URL. To solve this, we recommend to add placeholders into the HTML, like this: diff --git a/docusaurus/docs/using-https-in-development.md b/docusaurus/docs/using-https-in-development.md new file mode 100644 index 00000000..2117106e --- /dev/null +++ b/docusaurus/docs/using-https-in-development.md @@ -0,0 +1,32 @@ +--- +id: using-https-in-development +title: Using HTTPS in Development +--- + +> Note: this feature is available with `react-scripts@0.4.0` and higher. + +You may require the dev server to serve pages over HTTPS. One particular case where this could be useful is when using [the "proxy" feature](#proxying-api-requests-in-development) to proxy requests to an API server when that API server is itself serving HTTPS. + +To do this, set the `HTTPS` environment variable to `true`, then start the dev server as usual with `npm start`: + +#### Windows (cmd.exe) + +```cmd +set HTTPS=true&&npm start +``` + +(Note: the lack of whitespace is intentional.) + +#### Windows (Powershell) + +```Powershell +($env:HTTPS = $true) -and (npm start) +``` + +#### Linux, macOS (Bash) + +```bash +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. diff --git a/docusaurus/website/sidebars.json b/docusaurus/website/sidebars.json index 1cb8665c..d42e6b44 100644 --- a/docusaurus/website/sidebars.json +++ b/docusaurus/website/sidebars.json @@ -34,7 +34,8 @@ "adding-a-router", "adding-custom-environment-variables", "fetching-data-with-ajax-requests", - "integrating-with-an-api-backend" + "integrating-with-an-api-backend", + "using-https-in-development" ], "Testing": ["running-tests", "debugging-tests"], "Deployment": ["publishing-components-to-npm", "deployment"],