Skip to content

Commit

Permalink
Update proxying-api-requests-in-development.md
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LuizyHub committed Apr 12, 2024
1 parent 0a827f6 commit 34537f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docusaurus/docs/proxying-api-requests-in-development.md
Expand Up @@ -101,7 +101,7 @@ module.exports = function (app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://localhost:5000',
target: 'http://localhost:5000/api',
changeOrigin: true,
})
);
Expand All @@ -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.

0 comments on commit 34537f9

Please sign in to comment.