Skip to content

docs(readme): spelling and grammar fixes #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ received with a given prefix (or none) to an upstream. All Fastify hooks are sti
`@fastify/http-proxy` is built on top of
[`@fastify/reply-from`](https://npm.im/@fastify/reply-from), which enables single route proxying.

This plugin can be used in a variety of circumstances, for example if you have to proxy an internal domain to an external domain (useful to avoid CORS problems) or to implement your own API gateway for a microservices architecture.
This plugin can be used in a variety of circumstances, for example, if you have to proxy an internal domain to an external domain (useful to avoid CORS problems) or to implement your own API gateway for a microservices architecture.

## Requirements

Expand Down Expand Up @@ -39,7 +39,7 @@ server.register(require('@fastify/http-proxy'), {
server.listen({ port: 3000 });
```

This will proxy any request starting with `/api` to `http://my-api.example.com`. For instance `http://localhost:3000/api/users` will be proxied to `http://my-api.example.com/users`.
This will proxy any request starting with `/api` to `http://my-api.example.com`. For instance, `http://localhost:3000/api/users` will be proxied to `http://my-api.example.com/users`.

If you want to have different proxies on different prefixes you can register multiple instances of the plugin as shown in the following snippet:

Expand Down Expand Up @@ -81,9 +81,9 @@ server.register(proxy, {
server.listen({ port: 3000 });
```

Notice that in this case it is important to use the `prefix` option to tell the proxy how to properly route the requests across different upstreams.
Notice that in this case, it is important to use the `prefix` option to tell the proxy how to properly route the requests across different upstreams.

Also notice paths in `upstream` are ignored, so you need to use `rewritePrefix` to specify the target base path.
Also, notice paths in `upstream` are ignored, so you need to use `rewritePrefix` to specify the target base path.

For other examples, see [`example.js`](examples/example.js).

Expand Down Expand Up @@ -229,7 +229,7 @@ The default implementation forwards the `cookie` header.

## Benchmarks

The following benchmarks where generated on a dedicated server with an Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz and 64GB of RAM:
The following benchmarks were generated on a dedicated server with an Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz and 64GB of RAM:

| **Framework** | req/sec |
| :-------------------- | :------ |
Expand All @@ -247,4 +247,4 @@ URL`.

## License

MIT
Licensed under [MIT](./LICENSE).
Loading