Skip to content

fix(scaffold): no-frontend AppHost build + correct advertised health URL#1262

Merged
iammukeshm merged 1 commit into
mainfrom
fix/scaffold-no-frontend-build-and-health-url
May 27, 2026
Merged

fix(scaffold): no-frontend AppHost build + correct advertised health URL#1262
iammukeshm merged 1 commit into
mainfrom
fix/scaffold-no-frontend-build-and-health-url

Conversation

@iammukeshm
Copy link
Copy Markdown
Member

Found while smoke-testing the full template distribution (pack → install → fsh new → build → run).

1. --no-frontend scaffold didn't compile

The AppHost's api resource handle is only consumed by the React apps' .WithReference(api). With the frontend excluded, api becomes an unused local → S1481 under TreatWarningsAsErrors, so dotnet build of a --no-frontend scaffold failed. Added a //#else branch that discards it (_ = api;) so the no-frontend render stays warning-clean. The full (frontend) template — and the main repo — are unaffected (verified both build 0/0).

2. Advertised health URL was wrong

The CLI "Next Steps" and deploy/docker/README.md pointed at /health, which isn't a route — the probes are /health/live and /health/ready. A request to /health matches no endpoint, and the global fallback authorization policy (RequireAuthenticatedUser) returns 401 (not 404) for the unmatched path, so the advertised URL looked "broken." Pointed both at /health/live.

Verified end-to-end against a running stack: /health/live and /health/ready → 200, OpenAPI → 200 (132 paths), tenant login → 200, wrong password → 401, missing tenant header → 400.

🤖 Generated with Claude Code

Two issues surfaced while smoke-testing the template distribution end-to-end:

1. Scaffolding with --no-frontend produced an AppHost that didn't compile.
   The `api` resource handle is only consumed by the React apps'
   .WithReference(api), so excluding the frontend left it unused -> S1481
   under TreatWarningsAsErrors. Added a //#else branch that discards it
   (`_ = api;`) so the no-frontend render stays warning-clean; the full
   (frontend) template is unaffected.

2. The advertised health URL was wrong. The CLI "Next Steps" and the docker
   README pointed at /health, which is not a route -- the probes are
   /health/live and /health/ready. (A request to /health matches no endpoint
   and the global fallback authorization policy returns 401, not 404.)
   Point both at /health/live.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@iammukeshm iammukeshm merged commit 3787c2d into main May 27, 2026
15 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