Skip to content

Commit 66c9437

Browse files
authored
Update README.md
1 parent 87fa7fa commit 66c9437

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Fastify = require('fastify')
2727
const server = Fastify()
2828

2929
server.register(require('fastify-http-proxy'), {
30-
'http://my-api.example.com',
30+
upstream: 'http://my-api.example.com',
3131
prefix: '/api', // optional
3232
http2: false // optional
3333
})
@@ -45,20 +45,22 @@ const server = Fastify()
4545
const proxy = require('fastify-http-proxy')
4646

4747
server.register(proxy, {
48-
'http://my-api.example.com',
48+
upstream: 'http://my-api.example.com',
4949
prefix: '/api', // optional
5050
http2: false // optional
5151
})
5252

5353
server.register(proxy, {
54-
'http://single-signon.example.com/auth',
54+
upstream: 'http://single-signon.example.com/auth',
5555
prefix: '/auth', // optional
5656
http2: false // optional
5757
})
5858

5959
server.listen(3000)
6060
```
6161

62+
Notice that in these case it is important to use the `prefix` option and to have *non-ambiguous* or *non-overlapping* prefixes (e.g. `/api` and `/api2`).
63+
6264
For other examples, see `example.js`.
6365

6466
## Options

0 commit comments

Comments
 (0)