From 3f699fd08044de9ab0ce1991a66b376d3e1956a8 Mon Sep 17 00:00:00 2001 From: "Herman J. Radtke III" Date: Tue, 3 Mar 2020 17:23:51 -0800 Subject: [PATCH] Fix proxying API request docs (#8515) 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. --- docusaurus/docs/proxying-api-requests-in-development.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docusaurus/docs/proxying-api-requests-in-development.md b/docusaurus/docs/proxying-api-requests-in-development.md index 3fdfb778069..66563e25e45 100644 --- a/docusaurus/docs/proxying-api-requests-in-development.md +++ b/docusaurus/docs/proxying-api-requests-in-development.md @@ -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) { // ... @@ -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, })