From 34537f942bed7826963f40ea32f372eef0e43e23 Mon Sep 17 00:00:00 2001 From: CodingLuizy <104267255+LuizyHub@users.noreply.github.com> Date: Sat, 13 Apr 2024 02:47:58 +0900 Subject: [PATCH] Update proxying-api-requests-in-development.md followed by new [Version 3.0.0 breaking changes](https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#v3-breaking-changes) change sample code and description --- docusaurus/docs/proxying-api-requests-in-development.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/proxying-api-requests-in-development.md b/docusaurus/docs/proxying-api-requests-in-development.md index 11cf1198265..eeaba064583 100644 --- a/docusaurus/docs/proxying-api-requests-in-development.md +++ b/docusaurus/docs/proxying-api-requests-in-development.md @@ -101,7 +101,7 @@ module.exports = function (app) { app.use( '/api', createProxyMiddleware({ - target: 'http://localhost:5000', + target: 'http://localhost:5000/api', changeOrigin: true, }) ); @@ -113,3 +113,5 @@ module.exports = function (app) { > **Note:** This file only supports Node's JavaScript syntax. Be sure to only use supported language features (i.e. no support for Flow, ES Modules, etc). > **Note:** Passing the path to the proxy function allows you to use globbing and/or pattern matching on the path, which is more flexible than the express route matching. + +> **Note** When proxy is mounted on a path, this path should be provided in the target.