From 89d08256dfb9a175694f2f67d62cd69582a16a75 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Tue, 16 Sep 2025 12:37:28 -0700 Subject: [PATCH] chore(dev): env var for pointing to localhost --- CONTRIBUTING.md | 4 ++++ src/lib/config.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c63ca9a3..e7b967b31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,10 @@ bin/run.js openapi validate __tests__/__fixtures__/ref-oas/petstore.json Your changes to the command code may make changes to [the command reference documents](./documentation/commands) — it is up to you whether you include those changes in your PR or if you let the release process take care of it. More information on that can be found in [`MAINTAINERS.md`](./MAINTAINERS.md). +## ReadMe Development 🦉 + +If you're a ReadMe team member that's testing `rdme` against a non-production ReadMe environment, you can either set the `RDME_LOCALHOST=true` environment variable (which points your CLI to the localhost version of ReadMe) or modify the URLs in `src/lib/config.ts` directly. + ## Running GitHub Actions Locally 🐳 To run GitHub Actions locally, we'll be using [`act`](https://github.com/nektos/act) (make sure to read their [prerequisites list](https://github.com/nektos/act#necessary-prerequisites-for-running-act) and have that ready to go before installing `act`)! diff --git a/src/lib/config.ts b/src/lib/config.ts index 75c85f7a2..ba0b5a25a 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -1,7 +1,7 @@ const config = { host: { - v1: 'https://dash.readme.com', - v2: 'https://api.readme.com/v2', + v1: process.env.RDME_LOCALHOST ? 'http://dash.readme.local:3000' : 'https://dash.readme.com', + v2: process.env.RDME_LOCALHOST ? 'http://api.readme.local:3000/v2' : 'https://api.readme.com/v2', }, } as const;