-
Notifications
You must be signed in to change notification settings - Fork 455
feat: add configurable host binding for server and Vite dev server #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
chore: run npm audit fix
- Add HOST environment variable (default: 0.0.0.0) to allow binding to specific network interfaces - Update server to listen on configurable host instead of hardcoded localhost - Update Vite dev server to respect HOST environment variable - Enhanced server startup banner to display listening address - Updated .env.example and CLAUDE.md documentation Fixes #536 Co-authored-by: Web Dev Cody <webdevcody@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. Comment |
Summary of ChangesHello @webdevcody, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the network configuration flexibility of the application by allowing users to specify the host binding for both the backend and Vite development servers via a new Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a configurable host binding for both the backend server and the Vite dev server via the HOST environment variable. The changes are well-implemented and include updates to documentation and example files. My main feedback is a suggestion to improve the handling of IPv6 addresses in the server startup banner to ensure the generated URLs are always valid.
| : 'enabled' | ||
| : 'disabled'; | ||
| const portStr = port.toString().padEnd(4); | ||
| const hostDisplay = host === '0.0.0.0' ? 'localhost' : host; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for hostDisplay doesn't correctly handle IPv6 addresses for URL formatting in the startup banner. This can lead to broken links.
- The "listen on all" IPv6 address
::is not mapped tolocalhost. - Other IPv6 addresses (e.g.,
::1) are not wrapped in square brackets, which is required for URLs (e.g.,http://[::1]:3008).
The suggested code fixes the first point. For a more complete solution, consider also handling the bracketing for all IPv6 addresses.
| const hostDisplay = host === '0.0.0.0' ? 'localhost' : host; | |
| const hostDisplay = host === '0.0.0.0' || host === '::' ? 'localhost' : host; |
Fixes #536
Summary
Adds configurable host binding for both the backend server and Vite dev server. The hostname can now be configured via the
HOSTenvironment variable, defaulting to0.0.0.0to listen on all network interfaces.Changes
HOSTenvironment variable (default:0.0.0.0) to allow binding to specific network interfacesUsage
🤖 Generated with Claude Code