Skip to content

Commit 3f699fd

Browse files
authored
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.
1 parent 4d26208 commit 3f699fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docusaurus/docs/proxying-api-requests-in-development.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ $ yarn add http-proxy-middleware
8585
Next, create `src/setupProxy.js` and place the following contents in it:
8686

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

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

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

100100
module.exports = function(app) {
101101
app.use(
102102
'/api',
103-
proxy({
103+
createProxyMiddleware({
104104
target: 'http://localhost:5000',
105105
changeOrigin: true,
106106
})

0 commit comments

Comments
 (0)