Skip to content

Commit

Permalink
Fix proxying API request docs (#8515)
Browse files Browse the repository at this point in the history
The http-proxy-middleware package has made a major version upgraded and
introduced a breaking change. This fixes the "Configuring the Proxy
Manually" documentation to match the latest version.
  • Loading branch information
hjr3 committed Mar 4, 2020
1 parent 4d26208 commit 3f699fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docusaurus/docs/proxying-api-requests-in-development.md
Expand Up @@ -85,7 +85,7 @@ $ yarn add http-proxy-middleware
Next, create `src/setupProxy.js` and place the following contents in it:

```js
const proxy = require('http-proxy-middleware');
const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
// ...
Expand All @@ -95,12 +95,12 @@ module.exports = function(app) {
You can now register proxies as you wish! Here's an example using the above `http-proxy-middleware`:

```js
const proxy = require('http-proxy-middleware');
const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
app.use(
'/api',
proxy({
createProxyMiddleware({
target: 'http://localhost:5000',
changeOrigin: true,
})
Expand Down

0 comments on commit 3f699fd

Please sign in to comment.