From 3e15b21d01a69293e1412b3be3a8a28efcdd159b Mon Sep 17 00:00:00 2001 From: Pradish Bijukchhe Date: Thu, 11 Feb 2021 19:01:20 +0545 Subject: [PATCH] fix: move '/api' from use() to createProxyMiddleware() Path `'/api'` should be the first argument of `createProxyMiddleware()` function, not `use()`. --- docusaurus/docs/proxying-api-requests-in-development.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docusaurus/docs/proxying-api-requests-in-development.md b/docusaurus/docs/proxying-api-requests-in-development.md index 66563e25e45..53959b878a0 100644 --- a/docusaurus/docs/proxying-api-requests-in-development.md +++ b/docusaurus/docs/proxying-api-requests-in-development.md @@ -99,8 +99,7 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { app.use( - '/api', - createProxyMiddleware({ + createProxyMiddleware('/api', { target: 'http://localhost:5000', changeOrigin: true, })