Skip to content

Commit

Permalink
Reserve h for help, and format docs (#8407)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed May 24, 2023
1 parent a7334cf commit 70b7c4d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
30 changes: 15 additions & 15 deletions docs/docs/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1989,12 +1989,12 @@ yarn redwood serve [side]
`yarn rw serve` is useful for debugging locally or for self-hosting—deploying a single server into a serverful environment. Since both the api and the web sides run in the same server, CORS isn't a problem.
| Arguments & Options | Description |
| ------------------- | ------------------------------------------------------------------------------ |
| `side` | Which side(s) to run. Choices are `api` and `web`. Defaults to `api` and `web` |
| `--port` | What port should the server run on [default: 8911] |
| Arguments & Options | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `side` | Which side(s) to run. Choices are `api` and `web`. Defaults to `api` and `web` |
| `--port` | What port should the server run on [default: 8911] |
| `--host` | What host should the server run on. This defaults to the value of `web.host` in the `redwood.toml` file which itself defaults to `'localhost'`. |
| `--socket` | The socket the server should run. This takes precedence over port |
| `--socket` | The socket the server should run. This takes precedence over port |
### serve api
Expand All @@ -2006,12 +2006,12 @@ yarn rw serve api
This command uses `apiUrl` in your `redwood.toml`. Use this command if you want to run just the api side on a server (e.g. running on Render).
| Arguments & Options | Description |
| ------------------- | ----------------------------------------------------------------- |
| `--port` | What port should the server run on [default: 8911] |
| Arguments & Options | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `--port` | What port should the server run on [default: 8911] |
| `--host` | What host should the server run on. This defaults to the value of `api.host` in the `redwood.toml` file which itself defaults to `'localhost'`. |
| `--socket` | The socket the server should run. This takes precedence over port |
| `--apiRootPath` | The root path where your api functions are served |
| `--socket` | The socket the server should run. This takes precedence over port |
| `--apiRootPath` | The root path where your api functions are served |
For the full list of Server Configuration settings, see [this documentation](app-configuration-redwood-toml.md#api).
If you want to format your log output, you can pipe the command to the Redwood LogFormatter:
Expand All @@ -2034,12 +2034,12 @@ This command serves the contents in `web/dist`. Use this command if you're debug
>
> Probably, but it can be a challenge to setup when you just want something running quickly!
| Arguments & Options | Description |
| ------------------- | ------------------------------------------------------------------------------------- |
| `--port` | What port should the server run on [default: 8911] |
| Arguments & Options | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `--port` | What port should the server run on [default: 8911] |
| `--host` | What host should the server run on. This defaults to the value of `web.host` in the `redwood.toml` file which itself defaults to `'localhost'`. |
| `--socket` | The socket the server should run. This takes precedence over port |
| `--apiHost` | Forwards requests from the `apiUrl` (defined in `redwood.toml`) to the specified host |
| `--socket` | The socket the server should run. This takes precedence over port |
| `--apiHost` | Forwards requests from the `apiUrl` (defined in `redwood.toml`) to the specified host |
If you want to format your log output, you can pipe the command to the Redwood LogFormatter:
Expand Down
3 changes: 0 additions & 3 deletions packages/api-server/src/cliHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const commonOptions = {
host: {
default: redwoodProjectConfig.web.host,
type: 'string',
alias: 'h',
},
socket: { type: 'string' },
} as const
Expand All @@ -43,7 +42,6 @@ export const apiCliOptions = {
host: {
default: redwoodProjectConfig.api.host,
type: 'string',
alias: 'h',
},
socket: { type: 'string' },
apiRootPath: {
Expand All @@ -64,7 +62,6 @@ export const webCliOptions = {
host: {
default: redwoodProjectConfig.web.host,
type: 'string',
alias: 'h',
},
socket: { type: 'string' },
apiHost: {
Expand Down
1 change: 0 additions & 1 deletion packages/api-server/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const argv = yargs(hideBin(process.argv))
default: redwoodProjectConfig.api.port,
})
.option('host', {
alias: 'h',
description: 'Host',
type: 'string',
default: redwoodProjectConfig.api.host,
Expand Down
3 changes: 0 additions & 3 deletions packages/cli/src/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export async function builder(yargs) {
host: {
default: redwoodProjectConfig.web.host,
type: 'string',
alias: 'h',
},
socket: { type: 'string' },
}),
Expand Down Expand Up @@ -77,7 +76,6 @@ export async function builder(yargs) {
host: {
default: redwoodProjectConfig.api.host,
type: 'string',
alias: 'h',
},
socket: { type: 'string' },
apiRootPath: {
Expand Down Expand Up @@ -106,7 +104,6 @@ export async function builder(yargs) {
host: {
default: redwoodProjectConfig.web.host,
type: 'string',
alias: 'h',
},
socket: { type: 'string' },
apiHost: {
Expand Down

0 comments on commit 70b7c4d

Please sign in to comment.