diff --git a/.replit b/.replit index ec07c63..8c34536 100644 --- a/.replit +++ b/.replit @@ -1,2 +1,2 @@ -run = "pnpm dev" +run = "node build.mjs && PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} node --enable-source-maps dist/index.mjs" onBoot = "pnpm install --ignore-workspace" diff --git a/readme.md b/readme.md index 680e940..647c311 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Do not add this repo to a parent workspace. Do not move it into `artifacts/`. Do The repo includes `.replit`, so after import the Run button starts the app with: ```bash -pnpm dev +node build.mjs && PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} node --enable-source-maps dist/index.mjs ``` The `.replit` `onBoot` command installs dependencies with: @@ -35,7 +35,7 @@ Use the available `pnpm`. This repo intentionally has no `packageManager` pin. ## Start ```bash -pnpm dev +node build.mjs && PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} node --enable-source-maps dist/index.mjs ``` When Replit AI Integrations are provisioned, the app reads these variables automatically: @@ -45,10 +45,10 @@ When Replit AI Integrations are provisioned, the app reads these variables autom - `AI_INTEGRATIONS_ANTHROPIC_BASE_URL` - `AI_INTEGRATIONS_ANTHROPIC_API_KEY` -Provider CLI flags are still supported for manual overrides: +Provider CLI flags are still supported for manual overrides, but mass deployments should use env vars: ```bash -pnpm dev -- \ +pnpm start -- \ --openai-base-url "" \ --openai-api-key "" \ --anthropic-base-url "" \ diff --git a/replit.md b/replit.md index e74101f..fb657e7 100644 --- a/replit.md +++ b/replit.md @@ -33,7 +33,7 @@ Never use public official provider endpoints. ## Key Commands - `pnpm install --ignore-workspace` — install dependencies without joining a parent workspace -- `pnpm dev` — run API server locally on port `3000` +- `node build.mjs && node --enable-source-maps dist/index.mjs` — build and run API server locally on port `3000` - `pnpm run typecheck` — typecheck the server - `pnpm run build` — typecheck and build `dist/index.mjs` - `pnpm run build:fast` — build `dist/index.mjs` without typechecking @@ -41,7 +41,7 @@ Never use public official provider endpoints. ## Replit Configuration -- `.replit` `run` uses `pnpm dev` +- `.replit` `run` builds with `node build.mjs` and runs `dist/index.mjs` - `.replit` `onBoot` uses `pnpm install --ignore-workspace` - publishing from a parent workspace should configure root `.replit` deployment and create a shell web artifact diff --git a/setup.md b/setup.md index b4a478f..803c2a8 100644 --- a/setup.md +++ b/setup.md @@ -44,7 +44,7 @@ skills: 4. Create the smallest persistent workflow named "Random Proxy Simple" with this exact run command: - cd random-proxy-simple && pnpm dev -- --host 0.0.0.0 --port 3000 --proxy-api-key DEPLOYMENT_GENERATED_PROXY_TOKEN --openai-base-url "$AI_INTEGRATIONS_OPENAI_BASE_URL" --openai-api-key "$AI_INTEGRATIONS_OPENAI_API_KEY" --anthropic-base-url "$AI_INTEGRATIONS_ANTHROPIC_BASE_URL" --anthropic-api-key "$AI_INTEGRATIONS_ANTHROPIC_API_KEY" + cd random-proxy-simple && node build.mjs && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN node --enable-source-maps dist/index.mjs 5. Start/restart that workflow once.