diff --git a/AGENTS.md b/AGENTS.md index a30592f..11a6ce2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -645,6 +645,12 @@ session with **no other memory of this project**. So: at `/api/mints/*` — prod proxies via `public/_redirects` (`/api/mints/* → https://mintradar.org/api/mints/:splat 200`), dev via `server.proxy` in `vite.config.ts`. Data is unofficial/rate-limited; adding a mint is native-only. + ⚠️ **`vite.config.ts`'s `server.proxy` also covers `/api/nip05` → + `https://skate-spots.org` and `/api/ai` → `https://ai.skate-spots.org` + (2026-09-28).** Without them the dev server answers those production-only + endpoints with `index.html`, so the NIP-05 availability check showed + **"Could not check right now"** on localhost and dev AI silently fell back to + Pollinations. (Prod is unaffected — the functions are same-origin there.) ⚠️ **Relative `/api/*` paths don't work in the native app** (fixed 2026-09-27): the shell is served from `https://localhost`, so `/api/mints/known` hits the LOCAL asset server and returns `index.html` → `Unexpected token '<' … not valid diff --git a/vite.config.ts b/vite.config.ts index d2e4113..b9a72cf 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -21,6 +21,20 @@ export default defineConfig(() => ({ changeOrigin: true, secure: true, }, + // /api/nip05 (the name registry) and /api/ai are PRODUCTION-only (Netlify + // Function + the CVM-host proxy). Without a dev proxy the dev server + // answers them with index.html, so the NIP-05 availability check failed + // locally with "Could not check right now" and dev AI never worked. + '/api/nip05': { + target: 'https://skate-spots.org', + changeOrigin: true, + secure: true, + }, + '/api/ai': { + target: 'https://ai.skate-spots.org', + changeOrigin: true, + secure: true, + }, }, }, plugins: [