Skip to content

feat(server): allow exposing dev server on network via config#1785

Merged
cossssmin merged 2 commits into
masterfrom
feat/server-host
Jul 9, 2026
Merged

feat(server): allow exposing dev server on network via config#1785
cossssmin merged 2 commits into
masterfrom
feat/server-host

Conversation

@cossssmin

@cossssmin cossssmin commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added support for configuring the dev server host in project settings.
    • You can now bind the server to all interfaces or a specific address.
    • The command-line host option still takes priority when provided.
  • Bug Fixes
    • Ensures the dev server uses the resolved host value when no command-line override is given.
  • Tests
    • Added coverage for host precedence and fallback behavior.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 33f2453a-d3f3-4f24-8405-b8758d19be4e

📥 Commits

Reviewing files that changed from the base of the PR and between 95070e5 and 4c226ee.

📒 Files selected for processing (1)
  • src/tests/serve.test.ts

📝 Walkthrough

Walkthrough

Adds MaizzleConfig.server.host as a boolean-or-string option. serve() now resolves host from options.host with fallback to config, passes it to Vite, and tests cover precedence and fallback.

Changes

Server host configuration

Layer / File(s) Summary
Server host config type and docs
src/types/config.ts
Adds host?: boolean | string to MaizzleConfig.server with documentation noting the --host CLI flag takes precedence.
Resolve and apply host in serve()
src/serve.ts
Computes host from options.host ?? config.server?.host and uses it when configuring the Vite dev server.
Host resolution tests
src/tests/serve.test.ts
Adds tests that verify options.host overrides config.server.host, and that the config value is used when options.host is undefined.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding config-driven host exposure for the dev server.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 feat/server-host

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/serve.ts`:
- Line 83: Add test coverage in serve.test.ts for the host resolution logic in
serve(): verify that options.host takes precedence over config.server?.host when
both are present, and add a separate case confirming the config fallback is used
when options.host is undefined. Use the serve path and the host selection branch
in src/serve.ts as the target behavior, and keep the assertions focused on the
resolved host passed into the server startup flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4101e430-1f0f-4f58-b96e-bd9ed73808ee

📥 Commits

Reviewing files that changed from the base of the PR and between ea722bc and 95070e5.

📒 Files selected for processing (2)
  • src/serve.ts
  • src/types/config.ts

Comment thread src/serve.ts
@cossssmin cossssmin merged commit 39e9768 into master Jul 9, 2026
6 checks passed
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