Skip to content

feat: configurable backend base URL for local dev#8

Merged
ttttonyhe merged 1 commit into
masterfrom
start-dev-server-backend-8080
May 23, 2026
Merged

feat: configurable backend base URL for local dev#8
ttttonyhe merged 1 commit into
masterfrom
start-dev-server-backend-8080

Conversation

@ttttonyhe
Copy link
Copy Markdown
Member

Summary

  • Route all API URLs in src/config.jsx through NEXT_PUBLIC_API_BASE_URL, falling back to https://node.snapaper.com so production behavior is unchanged.
  • Add .env*.local to .gitignore for local-only overrides (e.g. NEXT_PUBLIC_API_BASE_URL=http://localhost:8080).
  • In file-download.js, use a same-origin ?download=1 link when the file URL is already on the current host, instead of round-tripping through files.snapaper.com.
  • Fix the Further Mathematics subject label in mbs.jsx (Mathematics (9231)Mathematics Further (9231)).

Test plan

  • pnpm dev with NEXT_PUBLIC_API_BASE_URL=http://localhost:8080 hits the local backend.
  • Production build (no env var) still hits node.snapaper.com.
  • Downloads work for both same-origin and files.snapaper.com paths.

🤖 Generated with Claude Code

- config.jsx: route API URLs through NEXT_PUBLIC_API_BASE_URL with production fallback
- .gitignore: ignore .env*.local
- file-download.js: use same-origin download when srcUrl points to current host
- mbs.jsx: correct Further Mathematics label

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 23, 2026 06:48
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
snapaper-react Ready Ready Preview, Comment May 23, 2026 6:49am

Request Review

@ttttonyhe ttttonyhe merged commit 0452656 into master May 23, 2026
2 of 3 checks passed
@ttttonyhe ttttonyhe review requested due to automatic review settings May 23, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant