Skip to content

🐛 fix(web): default API_BASE to /api/v1 when NEXT_PUBLIC is empty in …#34

Merged
LinMoQC merged 1 commit intomainfrom
fix/web-docker-standalone
Mar 26, 2026
Merged

🐛 fix(web): default API_BASE to /api/v1 when NEXT_PUBLIC is empty in …#34
LinMoQC merged 1 commit intomainfrom
fix/web-docker-standalone

Conversation

@LinMoQC
Copy link
Copy Markdown
Owner

@LinMoQC LinMoQC commented Mar 26, 2026

…prod

Avoid axios hitting /setup/status on the frontend origin; document split-domain rebuild.

Made-with: Cursor

Summary

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor / code cleanup
  • CI / tooling

Related issue

Closes #

Changes

How to test

Screenshots (if applicable)

Checklist

  • My code follows the project's coding conventions
  • I have run ./lyra lint and there are no type errors
  • I have added/updated tests for the changed functionality
  • I have updated the documentation if behavior changed
  • The PR title follows Conventional Commits format (feat:, fix:, etc.)
  • I have read the CONTRIBUTING.md

Summary by CodeRabbit

  • Chores
    • Improved API endpoint configuration to handle environment-dependent defaults with better validation.
    • Enhanced deployment documentation regarding API base URL configuration across different environments.

…prod

Avoid axios hitting /setup/status on the frontend origin; document split-domain rebuild.

Made-with: Cursor
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

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

Project Deployment Actions Updated (UTC)
lyra-note-web Ready Ready Preview, Comment Mar 26, 2026 7:21pm

@LinMoQC LinMoQC merged commit affbe2a into main Mar 26, 2026
3 of 4 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 261b06ba-e075-44b6-87f0-28044392af20

📥 Commits

Reviewing files that changed from the base of the PR and between d1551bc and 4a5fdef.

📒 Files selected for processing (2)
  • apps/web/src/lib/constants.ts
  • docker-compose.prod.yml

📝 Walkthrough

Walkthrough

The API base URL handling in the web application was updated to intelligently validate environment variables and apply environment-dependent defaults. Production deployments now default to relative path /api/v1, while development uses localhost. Configuration documentation was added to clarify deployment scenarios.

Changes

Cohort / File(s) Summary
API Configuration Logic
apps/web/src/lib/constants.ts
Updated API_BASE constant to validate and trim NEXT_PUBLIC_API_BASE_URL, with environment-dependent fallback: /api/v1 in production, http://localhost:8000/api/v1 otherwise.
Docker Deployment Documentation
docker-compose.prod.yml
Added inline comments clarifying NEXT_PUBLIC_API_BASE_URL configuration for same-origin proxying and separate domain scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops through env variables clean,
Trimming whitespace like lettuce so green,
Production and dev now know their own way,
Base URLs configured for a better API day! 🌱

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/web-docker-standalone

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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