also looking at this
Merge @stacksjs/ts-css into this repo as packages/toolkit
#27
128 files
+9797
-201
| @@ -0,0 +1,67 @@ | ||
| 1 | # Configuration | |
| 2 | ||
| 3 | _This is just an example of the ts-starter docs._ | |
| 4 | ||
| 5 | The Reverse Proxy can be configured using a `reverse-proxy.config.ts` _(or `reverse-proxy.config.js`)_ file and it will be automatically loaded when running the `reverse-proxy` command. | |
| 6 | ||
| 7 | ```ts | |
| 8 | // reverse-proxy.config.{ts,js} | |
| 9 | import type { ReverseProxyOptions } from '@stacksjs/rpx' | |
| 10 | import os from 'node:os' | |
| 11 | import path from 'node:path' | |
| 12 | ||
| 13 | const config: ReverseProxyOptions = { | |
| 14 | /** | |
| 15 | * The from URL to proxy from. | |
| 16 | * Default: localhost:5173 | |
| 17 | */ | |
| 18 | from: 'localhost:5173', | |
| 19 | ||
| 20 | /** | |
| 21 | * The to URL to proxy to. | |
| 22 | * Default: stacks.localhost | |
| 23 | */ | |
| 24 | to: 'stacks.localhost', | |
| 25 | ||
| 26 | /** | |
| 27 | * The HTTPS settings. | |
| 28 | * Default: true | |
| 29 | * If set to false, the proxy will use HTTP. | |
| 30 | * If set to true, the proxy will use HTTPS. | |
| 31 | * If set to an object, the proxy will use HTTPS with the provided settings. | |
| 32 | */ | |
| 33 | https: { | |
| 34 | domain: 'stacks.localhost', | |
| 35 | hostCertCN: 'stacks.localhost', | |
| 36 | caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`), | |
| 37 | certPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt`), | |
| 38 | keyPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`), | |
| 39 | altNameIPs: ['127.0.0.1'], | |
| 40 | altNameURIs: ['localhost'], | |
| 41 | organizationName: 'stacksjs.org', | |
| 42 | countryName: 'US', | |
| 43 | stateName: 'California', | |
| 44 | localityName: 'Playa Vista', | |
| 45 | commonName: 'stacks.localhost', | |
| 46 | validityDays: 180, | |
| 47 | verbose: false, | |
| 48 | }, | |
| 49 | ||
| 50 | /** | |
| 51 | * The verbose setting. | |
| 52 | * Default: false | |
| 53 | * If set to true, the proxy will log more information. | |
| 54 | */ | |
| 55 | verbose: false, | |
| 56 | } | |
| 57 | ||
| 58 | export default config | |
| 59 | ``` | |
| 60 | ||
| 61 | _Then run:_ | |
| 62 | ||
| 63 | ```bash | |
| 64 | ./rpx start | |
| 65 | ``` | |
| 66 | ||
| 67 | To learn more, head over to the [documentation](https://reverse-proxy.sh/). | |