From ef0fcffc1d4f02cb6f68625c3a5502602cd16e66 Mon Sep 17 00:00:00 2001 From: szabi Date: Sat, 13 Jul 2019 10:55:14 +0200 Subject: [PATCH] Correcting proxy sample The previous sample didn't work, revised the sample, after checking the documentation of the `http-proxy-middleware` package and testing it on local env. --- docusaurus/docs/proxying-api-requests-in-development.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/proxying-api-requests-in-development.md b/docusaurus/docs/proxying-api-requests-in-development.md index a113f4d4211..420663b2760 100644 --- a/docusaurus/docs/proxying-api-requests-in-development.md +++ b/docusaurus/docs/proxying-api-requests-in-development.md @@ -96,7 +96,10 @@ You can now register proxies as you wish! Here's an example using the above `htt const proxy = require('http-proxy-middleware'); module.exports = function(app) { - app.use(proxy('/api', { target: 'http://localhost:5000/' })); + app.use('/api', proxy({ + target: 'http://localhost:5000', + changeOrigin: true, + })); }; ```