Skip to content

Commit 7c65ba7

Browse files
authored
Revert change to http-proxy-middleware docs (facebook#5252)
1 parent bb95472 commit 7c65ba7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-scripts/template/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ yarn upgrade babel-plugin-relay@dev
869869
Then, wherever you use the `graphql` template tag, import the macro:
870870

871871
```js
872-
import graphql from "babel-plugin-relay/macro";
872+
import graphql from 'babel-plugin-relay/macro';
873873
// instead of:
874874
// import { graphql } from "babel-plugin-relay"
875875

@@ -1211,14 +1211,16 @@ You can now register proxies as you wish! Here's an example using the above `htt
12111211
const proxy = require('http-proxy-middleware');
12121212

12131213
module.exports = function(app) {
1214-
app.use('/api', proxy({ target: 'http://localhost:5000/' }));
1214+
app.use(proxy('/api', { target: 'http://localhost:5000/' }));
12151215
};
12161216
```
12171217

12181218
> **Note:** You do not need to import this file anywhere. It is automatically registered when you start the development server.
12191219
12201220
> **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).
12211221
1222+
> **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.
1223+
12221224
## Using HTTPS in Development
12231225

12241226
> Note: this feature is available with `react-scripts@0.4.0` and higher.

0 commit comments

Comments
 (0)