You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Integrating with a Node Backend](#integrating-with-a-node-backend)
26
26
-[Proxying API Requests in Development](#proxying-api-requests-in-development)
27
+
-[Using HTTPS in Development](#using-https-in-development)
27
28
-[Adding `<meta>` Tags](#adding-meta-tags)
28
29
-[Running Tests](#running-tests)
29
30
-[Filename Conventions](#filename-conventions)
@@ -526,6 +527,28 @@ If the `proxy` option is **not** flexible enough for you, alternatively you can:
526
527
* Enable CORS on your server ([here’s how to do it for Express](http://enable-cors.org/server_expressjs.html)).
527
528
* Use [environment variables](#adding-custom-environment-variables) to inject the right server host and port into your app.
528
529
530
+
## Using HTTPS in Development
531
+
532
+
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.
533
+
534
+
To do this, set the `HTTPS` environment variable to `true`, then start the dev server as usual with `npm start`:
535
+
536
+
#### Windows (cmd.exe)
537
+
538
+
```cmd
539
+
set HTTPS=true&&npm start
540
+
```
541
+
542
+
(Note: the lack of whitespace is intentional.)
543
+
544
+
#### Linux, OS X (Bash)
545
+
546
+
```bash
547
+
HTTPS=true npm start
548
+
```
549
+
550
+
Note that the server will use a self-signed certificate, so your web browser will almost definitely display a warning upon accessing the page.
551
+
529
552
## Adding `<meta>` Tags
530
553
531
554
You can edit the generated `index.html` and add any tags you’d like to it. However, since Create React App doesn’t support server rendering, you might be wondering how to make `<meta>` tags dynamic and reflect the current URL.
0 commit comments