Repository navigation
Switch to ChilliCream.Nitro.App.Embed - #10641
Draft
tobias-tengler wants to merge 6 commits into
Draft
tobias-tengler wants to merge 6 commits into
tobias-tengler wants to merge 6 commits into
Conversation
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.
Contributor
|
✅ Nitro CLI E2E snapshots: no flow recordings changed vs |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.