diff --git a/qstash/howto/local-development.mdx b/qstash/howto/local-development.mdx index e8107608..745bc6c2 100644 --- a/qstash/howto/local-development.mdx +++ b/qstash/howto/local-development.mdx @@ -22,6 +22,9 @@ npx @upstash/qstash-cli dev // Start on a different port npx @upstash/qstash-cli dev -port=8081 + +// Start with a custom log server port +npx @upstash/qstash-cli dev -port=8081 -log-port=9000 ``` Once you start the local server, you can go to the QStash tab on Upstash Console and enable local mode, which will allow you to publish requests and monitor messages with the local server. @@ -60,12 +63,25 @@ Currently, the only available command for QStash CLI is `dev`, which starts a de ``` $ ./qstash dev --help Usage of dev: + -log-port int + Port to run the QStash log server on [env QSTASH_DEV_LOG_PORT] -port int - The port to start HTTP server at [env QSTASH_DEV_PORT] (default 8080) + Port to run the QStash server on [env QSTASH_DEV_PORT] (default 8080) -quota string The quota of users [env QSTASH_DEV_QUOTA] (default "payg") ``` +### Server Components + +Running `qstash dev` starts two components: + +- **QStash server** — the main API server, defaults to port `8080`. Use `-port` or `QSTASH_DEV_PORT` to change it. +- **Log server** — serves logs and is used by the Upstash Console and Logs API. Defaults to `port + 1` (i.e., `8081` when using the default port). Use `-log-port` or `QSTASH_DEV_LOG_PORT` to change it. + +``` +# Start with custom ports for both components +$ ./qstash dev -port=8080 -log-port=9000 +``` There are predefined test users available. You can configure the quota type of users using the `-quota` option, with available options being `payg` and `pro`. These quotas don't affect performance but allow you to simulate different server limits based on the subscription tier.