Skip to content

Switch to ChilliCream.Nitro.App.Embed - #10641

Draft
tobias-tengler wants to merge 6 commits into
mainfrom
tte/adopt-nitro-app-middleware
Draft

tobias-tengler wants to merge 6 commits into
mainfrom
tte/adopt-nitro-app-middleware

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

ChilliCream.Nitro.App now dispatches on the slug route value instead of
matching a configured path, so it works under MapGroup. Drop the path
argument from UseNitroApp, and for hosts without endpoint routing (Azure
Functions and IApplicationBuilder.MapGraphQL used as plain middleware) set
the slug from the GraphQL path before invoking NitroAppMiddleware.
ChilliCream.Nitro.App no longer contains the embedded Nitro app; it moved
to the ChilliCream.Nitro.App.Embed package. Reference the embed package
and pass its embedded files to the Nitro middleware, so ServeMode.Embedded
keeps working for MapGraphQL, MapNitroApp and Azure Functions.

The embed package also adds WithEmbeddedNitroAssets(), which serves the
embedded Nitro app on a GraphQL endpoint, a Nitro app endpoint or a route
group. Add tests for it and document it, including that ServeMode.Embedded
is removed in Hot Chocolate 17.
ChilliCream.Nitro.App now only reads the slug route value on the endpoint
the Nitro app is mounted on. Elsewhere, the host sets the path with
NitroAppMiddleware.SetSlug, so MapGraphQL sets it whenever the request is
below the GraphQL path, also when another endpoint matched.
The MapGraphQL and MapNitroApp endpoints use UseNitroApp, which serves the
slug route value. Hosts without endpoint routing (Azure Functions and
IApplicationBuilder.MapGraphQL used as middleware) use
NitroAppMiddleware.Create(options, path). SetNitroAppSlug is gone.

MayReachNitroApp compared the request path with the group-relative GraphQL
path, so inside a MapGroup every request reached the Nitro app and GraphQL
clients got Nitro's HTML or a redirect. On an endpoint, an empty slug now
identifies the GraphQL endpoint path.
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Nitro CLI E2E snapshots: no flow recordings changed vs main.

Cover the Nitro app root and config file in both the in-process and the
isolated model, and that Tool.Enable = false turns the Nitro app off.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant