Const
Fix proxied body if bodyParser is involved.
createProxyMiddleware({ target: 'http://example.com', on: { proxyReq: fixRequestBody, }}); Copy
createProxyMiddleware({ target: 'http://example.com', on: { proxyReq: fixRequestBody, }});
Alternative solution without using fixRequestBody(): put http-proxy-middleware before bodyParser in the middleware stack.
fixRequestBody()
http-proxy-middleware
bodyParser
Github issue #40 - POST request body is not proxied
Fix proxied body if bodyParser is involved.