diff --git a/.cursorrules b/.cursorrules index 9b8e56e20..10a164341 100644 --- a/.cursorrules +++ b/.cursorrules @@ -326,7 +326,7 @@ npx @opennextjs/cloudflare build npx wrangler deploy ``` -Update `wrangler.jsonc` with new env vars in `vars` section. +**Important:** Always use `npx wrangler deploy` without any `--env` flags. The deployment uses the default configuration from `wrangler.jsonc` with route `agents.nicholai.work`. Update `wrangler.jsonc` with new env vars in the top-level `vars` section. ## Debugging Tips diff --git a/CLAUDE.md b/CLAUDE.md index e48cfb072..ae9727dca 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -22,11 +22,12 @@ pnpm test:coverage # Generate test coverage report ```bash npx @opennextjs/cloudflare build # Convert Next.js build to Cloudflare Workers format npx wrangler deploy # Deploy to Cloudflare (requires OpenNext build first) -npx wrangler deploy --env="" # Deploy to default environment explicitly npx wrangler tail # View live logs from deployed worker ``` -**Critical**: Always run `npx @opennextjs/cloudflare build` before deploying. The standard `next build` alone is insufficient for Cloudflare deployment. +**Critical**: +- Always run `npx @opennextjs/cloudflare build` before deploying. The standard `next build` alone is insufficient for Cloudflare deployment. +- Always use `npx wrangler deploy` without any `--env` flags. The deployment uses the default configuration from `wrangler.jsonc` with route `agents.nicholai.work`. ## Architecture @@ -111,8 +112,10 @@ The route handles multiple n8n response formats: ### wrangler.jsonc - Worker entry: `.open-next/worker.js` (generated by OpenNext) - Assets directory: `.open-next/assets` -- Production route: `agents.nicholai.work` +- Route: `agents.nicholai.work` (configured at top level, not in env section) +- Environment variables: Configured in top-level `vars` section - Compatibility flags: `nodejs_compat`, `global_fetch_strictly_public` +- **Important:** Deployment uses default configuration - do not use `--env` flags ### Build Output - Standard Next.js build: `.next/` diff --git a/README.md b/README.md index 214a58573..a0025cb3a 100644 --- a/README.md +++ b/README.md @@ -218,10 +218,7 @@ Deploy to Cloudflare Workers: npx wrangler deploy ``` - Or for specific environment: - ```bash - npx wrangler deploy --env production - ``` + **Note:** The deployment uses the default configuration from `wrangler.jsonc` with route `agents.nicholai.work`. Do not use `--env` flags. 3. **View logs** ```bash diff --git a/wrangler.jsonc b/wrangler.jsonc index 8414162dd..67f9f6e5c 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -12,20 +12,17 @@ "nodejs_compat", "global_fetch_strictly_public" ], - "env": { - "production": { - "route": "agents.nicholai.work", - "vars": { - "AGENT_1_URL": "https://n8n.biohazardvfx.com/webhook/d2ab4653-a107-412c-a905-ccd80e5b76cd", - "AGENT_1_NAME": "Repoguide", - "AGENT_1_DESCRIPTION": "Documenting the development process.", - "AGENT_2_URL": "https://n8n.biohazardvfx.com/webhook/0884bd10-256d-441c-971c-b9f1c8506fdf", - "AGENT_2_NAME": "Morgan", - "AGENT_2_DESCRIPTION": "System Prompt Designer", - "IMAGE_UPLOADS_ENABLED": "true", - "DIFF_TOOL_ENABLED": "true" - } - } + "route": "agents.nicholai.work", + "vars": { + "AGENT_1_URL": "https://n8n.biohazardvfx.com/webhook/d2ab4653-a107-412c-a905-ccd80e5b76cd", + "AGENT_1_NAME": "Repoguide", + "AGENT_1_DESCRIPTION": "Documenting the development process.", + "AGENT_2_URL": "https://n8n.biohazardvfx.com/webhook/0884bd10-256d-441c-971c-b9f1c8506fdf", + "AGENT_2_NAME": "Morgan", + "AGENT_2_DESCRIPTION": "System Prompt Designer", + "CUSTOM_AGENT_WEBHOOK": "https://n8n.biohazardvfx.com/webhook-test/7cbdc539-526f-425f-abea-0886ec4c1e76", + "IMAGE_UPLOADS_ENABLED": "true", + "DIFF_TOOL_ENABLED": "true" }, "assets": { "binding": "ASSETS",