From f736065b4cd3ca52af7888aa36d1f793d83dbd0d Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Tue, 2 Oct 2018 10:58:40 -0600 Subject: [PATCH] Revert change to http-proxy-middleware docs --- packages/react-scripts/template/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 7d0c880c7c2..2dab1ec2ee1 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -869,7 +869,7 @@ yarn upgrade babel-plugin-relay@dev Then, wherever you use the `graphql` template tag, import the macro: ```js -import graphql from "babel-plugin-relay/macro"; +import graphql from 'babel-plugin-relay/macro'; // instead of: // import { graphql } from "babel-plugin-relay" @@ -1211,7 +1211,7 @@ You can now register proxies as you wish! Here's an example using the above `htt const proxy = require('http-proxy-middleware'); module.exports = function(app) { - app.use('/api', proxy({ target: 'http://localhost:5000/' })); + app.use(proxy('/api', { target: 'http://localhost:5000/' })); }; ``` @@ -1219,6 +1219,8 @@ module.exports = function(app) { > **Note:** This file only supports Node's JavaScript syntax. Be sure to only use supported language features (i.e. no support for Flow, ES Modules, etc). +> **Note:** Passing the path to the proxy function allows you to use globbing and/or pattern matching on the path, which is more flexible than the express route matching. + ## Using HTTPS in Development > Note: this feature is available with `react-scripts@0.4.0` and higher.