Skip to content

Commit

Permalink
docs(readme): fix example code syntax error (#1014)
Browse files Browse the repository at this point in the history
* docs(readme): fix example code syntax error
* chore(README): lint fix

---------

Co-authored-by: Steven Chim <[email protected]>
  • Loading branch information
17hz and chimurai authored Oct 7, 2024
1 parent 8161d91 commit 3d6134b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ import type { Filter, Options, RequestHandler } from 'http-proxy-middleware';
const app = express();

const proxyMiddleware = createProxyMiddleware<Request, Response>({
target: 'http://www.example.org/api',
changeOrigin: true,
}),
target: 'http://www.example.org/api',
changeOrigin: true,
});

app.use('/api', proxyMiddleware);

app.listen(3000);

// proxy and keep the same base path "/api"
// http://127.0.0.1:3000/api/foo/bar -> http://www.example.org/api/foo/bar

```

_All_ `http-proxy` [options](https://github.com/nodejitsu/node-http-proxy#options) can be used, along with some extra `http-proxy-middleware` [options](#options).
Expand Down

0 comments on commit 3d6134b

Please sign in to comment.