Skip to content

Commit 08e61e8

Browse files
committed
chore: update readme
1 parent 52d7115 commit 08e61e8

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,40 @@ const config: ReverseProxyOptions = {
6262
startProxy(config)
6363
```
6464

65+
In case you are trying to start multiple proxies, you may use this configuration:
66+
67+
```ts
68+
// reverse-proxy.config.{ts,js}
69+
import type { ReverseProxyOptions } from '@stacksjs/rpx'
70+
import os from 'node:os'
71+
import path from 'node:path'
72+
73+
const config: ReverseProxyOptions = {
74+
https: { // https: true -> also works with sensible defaults
75+
caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`),
76+
certPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt`),
77+
keyPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`),
78+
},
79+
80+
etcHostsCleanup: true,
81+
82+
proxies: [
83+
{
84+
from: 'localhost:5173',
85+
to: 'my-app.localhost',
86+
},
87+
{
88+
from: 'localhost:5174',
89+
to: 'my-api.local',
90+
},
91+
],
92+
93+
verbose: true,
94+
}
95+
96+
export default config
97+
```
98+
6599
### CLI
66100

67101
```bash
@@ -106,40 +140,6 @@ const config: ReverseProxyOptions = {
106140
export default config
107141
```
108142

109-
In case you are trying to start multiple proxies, you may use this configuration:
110-
111-
```ts
112-
// reverse-proxy.config.{ts,js}
113-
import type { ReverseProxyOptions } from '@stacksjs/rpx'
114-
import os from 'node:os'
115-
import path from 'node:path'
116-
117-
const config: ReverseProxyOptions = {
118-
https: { // https: true -> also works with sensible defaults
119-
caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`),
120-
certPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt`),
121-
keyPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`),
122-
},
123-
124-
etcHostsCleanup: true,
125-
126-
proxies: [
127-
{
128-
from: 'localhost:5173',
129-
to: 'my-app.localhost',
130-
},
131-
{
132-
from: 'localhost:5174',
133-
to: 'my-api.local',
134-
},
135-
],
136-
137-
verbose: true,
138-
}
139-
140-
export default config
141-
```
142-
143143
_Then run:_
144144

145145
```bash

0 commit comments

Comments
 (0)