Skip to content

fix: serve static mode files#7

Merged
josbeir merged 2 commits intomainfrom
fix/servce-static-mode
Mar 14, 2026
Merged

fix: serve static mode files#7
josbeir merged 2 commits intomainfrom
fix/servce-static-mode

Conversation

@josbeir
Copy link
Copy Markdown
Owner

@josbeir josbeir commented Mar 14, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 14, 2026 14:13
@josbeir josbeir force-pushed the fix/servce-static-mode branch from 7460d44 to ba12d8b Compare March 14, 2026 14:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a static-serve fallback to the development router so glaze serve --static can serve pre-built public/ HTML through the same dev-router.php entrypoint as live mode, controlled via a new GLAZE_STATIC_MODE environment flag.

Changes:

  • Introduces StaticPageRequestHandler to serve pre-built index.html pages + static 404 handling (basePath-aware, redirecting directory paths to trailing slashes).
  • Updates ServeCommand/PhpServerProcess to always use dev-router.php and pass GLAZE_STATIC_MODE into the PHP server process.
  • Updates/expands unit + integration tests to reflect router requirements and static-mode behavior.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Http/StaticPageRequestHandler.php New request handler serving pre-built static HTML in static-serve mode.
bin/dev-router.php Switches fallback handler based on GLAZE_STATIC_MODE (static vs live).
src/Command/ServeCommand.php Sets router env for both modes; disables Vite in static mode unless explicitly requested (then errors).
src/Process/PhpServerProcess.php Always builds PHP server command with router; forwards GLAZE_STATIC_MODE.
tests/Unit/Http/StaticPageRequestHandlerTest.php New unit tests covering static handler routing/redirect/basePath behavior.
tests/Unit/Process/PhpServerProcessTest.php Updates tests for router-required behavior + env forwarding changes.
tests/Unit/Command/ServeCommandTest.php Updates environment/Vite resolution tests to include static-mode semantics.
tests/Integration/Command/ServeCommandTest.php Aligns expected router-missing error message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@josbeir josbeir merged commit e74c900 into main Mar 14, 2026
7 checks passed
@josbeir josbeir deleted the fix/servce-static-mode branch March 15, 2026 08:44
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