Skip to content

docs(cli): document static file serving#210

Merged
pi0 merged 2 commits into
h3js:mainfrom
atinux:docs/cli-static-serving
Jun 17, 2026
Merged

docs(cli): document static file serving#210
pi0 merged 2 commits into
h3js:mainfrom
atinux:docs/cli-static-serving

Conversation

@atinux

@atinux atinux commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Documents static file serving in the CLI, which was already supported but undocumented.

  • Add a --static example to the CLI usage/help block
  • Add a "Serving static files" section to the CLI guide covering the serve-equivalent npx srvx --static ./dist, default public/ behavior, fall-through to the handler, and programmatic serveStatic usage

Summary by CodeRabbit

  • Documentation
    • Added guide for serving static files using the --static flag with practical examples.
    • Documented features: index resolution, HTML fallback, MIME types, compression, and path-traversal protection.
    • Included programmatic usage examples for developers integrating static file serving.

@atinux atinux requested a review from pi0 as a code owner June 17, 2026 13:35
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87122f1e-6f68-4761-bfbc-638ae385ff10

📥 Commits

Reviewing files that changed from the base of the PR and between 8b50a82 and b3c53b6.

📒 Files selected for processing (1)
  • docs/1.guide/9.cli.md
 __________________________________________
< Fight fire with fire. Review AI with AI. >
 ------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
📝 Walkthrough

Walkthrough

The PR documents the --static CLI flag for srvx serve. One line is added to the CLI help text in src/cli/usage.ts showing serve --static=./dist, and the CLI guide gains a new "Serving static files" section with behavioral details and a serveStatic programmatic example.

Changes

Static file serving documentation

Layer / File(s) Summary
CLI help text: --static example line
src/cli/usage.ts
Inserts a serve --static=./dist example with a descriptive comment into the usage() help string.
CLI guide: --static example and Serving static files section
docs/1.guide/9.cli.md
Adds --static=./dist to the CLI usage block and introduces a new section describing --static behavior, the default public/ fallback, static-over-handler precedence, supported features (index resolution, .html fallback, MIME types, compression, path-traversal protection), and a serveStatic middleware code example.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • h3js/srvx#175: Modifies the same src/cli/usage.ts file, overlapping with the CLI help text generation code where the new --static example line is inserted.

Poem

🐇 Hop, hop, a flag appears today,
--static=./dist shows the way!
With index files and MIME types bright,
The public folder served just right.
No handler needed, the rabbit says—
Just point and serve your static days! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(cli): document static file serving' accurately and concisely describes the main change—adding documentation for static file serving in the CLI guide.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Tip

CodeRabbit can use SkillSpector to scan AI agent skill manifests and MCP configurations for security risks.

SkillSpector analyzes SKILL.md files and MCP configuration files such as mcp.json for vulnerabilities, malicious patterns, and other security issues. See the SkillSpector documentation for details.

@pkg-pr-new

pkg-pr-new Bot commented Jun 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/srvx@210

commit: b3c53b6

Comment thread docs/1.guide/9.cli.md Outdated

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

❤️

@pi0 pi0 merged commit 8c07e6e into h3js:main Jun 17, 2026
12 of 13 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.

2 participants