Skip to content

Update NEMAD API base URL#65

Open
Yibo-Zhang wants to merge 2 commits into
pathintegral-institute:mainfrom
Yibo-Zhang:main
Open

Update NEMAD API base URL#65
Yibo-Zhang wants to merge 2 commits into
pathintegral-institute:mainfrom
Yibo-Zhang:main

Conversation

@Yibo-Zhang

@Yibo-Zhang Yibo-Zhang commented Jul 18, 2025

Copy link
Copy Markdown
Contributor

User description

The backend API URL has changed. Updated the hardcoded URL from
https://nemad.org/api to
https://api.nemad.org/api.

Also made the URL configurable via NEMAD_BASE_URL environment variable for better flexibility.


PR Type

Bug fix, Enhancement


Description

  • Updated NEMAD API base URL from https://nemad.org/api to https://api.nemad.org/api

  • Made base URL configurable via NEMAD_BASE_URL environment variable


Diagram Walkthrough

flowchart LR
  A["Hardcoded URL"] --> B["Environment Variable"]
  B --> C["Default: api.nemad.org/api"]
  B --> D["Configurable via NEMAD_BASE_URL"]
Loading

File Walkthrough

Relevant files
Configuration changes
server.py
Make NEMAD base URL configurable                                                 

servers/nemad/src/nemad/server.py

  • Replaced hardcoded NEMAD_BASE_URL with environment variable lookup
  • Set new default URL to https://api.nemad.org/api
  • Added fallback mechanism using os.getenv() with default value
+1/-2     

Summary by CodeRabbit

  • Chores
    • Improved application deployment flexibility by making the API endpoint configurable via environment variables, eliminating the need for code changes when deploying to different environments.

Changed hardcoded URL from https://nemad.org/api to configurable
environment variable with https://api.nemad.org/api as default.
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Configuration Change

The hardcoded URL change from nemad.org to api.nemad.org should be validated to ensure the new endpoint is correct and accessible. The environment variable fallback mechanism should also be tested.

NEMAD_BASE_URL = os.getenv("NEMAD_BASE_URL", "https://api.nemad.org/api")

@qodo-code-review

qodo-code-review Bot commented Jul 18, 2025

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4db9589c-dfbe-4c79-afd8-937e44294324

📥 Commits

Reviewing files that changed from the base of the PR and between 4dcc2cb and 2960c0e.

📒 Files selected for processing (1)
  • servers/nemad/src/nemad/server.py

📝 Walkthrough

Walkthrough

The NEMAD_BASE_URL constant in the server configuration was changed from a hard-coded value to dynamically read from an environment variable with a fallback default. This enables runtime configuration of the API endpoint without code modifications.

Changes

Cohort / File(s) Summary
Configuration Update
servers/nemad/src/nemad/server.py
Replaced hard-coded NEMAD_BASE_URL with environment variable NEMAD_BASE_URL, defaulting to https://api.nemad.org/api if unset.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A URL once carved in stone so deep,
Now dances free from config's sleep,
Environment whispers its secret way,
While defaults guard the light of day,
Configuration blooms—hop, hop, hooray! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update NEMAD API base URL' directly and clearly summarizes the main change: making the NEMAD base URL configurable via environment variables with a new default.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants