Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Dec 2, 2024
1 parent 52d7115 commit 08e61e8
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,40 @@ const config: ReverseProxyOptions = {
startProxy(config)
```

In case you are trying to start multiple proxies, you may use this configuration:

```ts
// reverse-proxy.config.{ts,js}
import type { ReverseProxyOptions } from '@stacksjs/rpx'
import os from 'node:os'
import path from 'node:path'

const config: ReverseProxyOptions = {
https: { // https: true -> also works with sensible defaults
caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`),
certPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt`),
keyPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`),
},

etcHostsCleanup: true,

proxies: [
{
from: 'localhost:5173',
to: 'my-app.localhost',
},
{
from: 'localhost:5174',
to: 'my-api.local',
},
],

verbose: true,
}

export default config
```

### CLI

```bash
Expand Down Expand Up @@ -106,40 +140,6 @@ const config: ReverseProxyOptions = {
export default config
```

In case you are trying to start multiple proxies, you may use this configuration:

```ts
// reverse-proxy.config.{ts,js}
import type { ReverseProxyOptions } from '@stacksjs/rpx'
import os from 'node:os'
import path from 'node:path'

const config: ReverseProxyOptions = {
https: { // https: true -> also works with sensible defaults
caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`),
certPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt`),
keyPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`),
},

etcHostsCleanup: true,

proxies: [
{
from: 'localhost:5173',
to: 'my-app.localhost',
},
{
from: 'localhost:5174',
to: 'my-api.local',
},
],

verbose: true,
}

export default config
```

_Then run:_

```bash
Expand Down

0 comments on commit 08e61e8

Please sign in to comment.