feat(mrt-reference-app): add /outbound-loop route that calls the external domain#591
Draft
kieran-sf wants to merge 2 commits into
Draft
feat(mrt-reference-app): add /outbound-loop route that calls the external domain#591kieran-sf wants to merge 2 commits into
kieran-sf wants to merge 2 commits into
Conversation
…rnal domain Adds an outboundLoopTest reference route that fetches the app's own storefront via EXTERNAL_DOMAIN_NAME (optional ?path= override) with an x-mrt-loop header and passes the upstream status, content-type, and body back verbatim. Also emits build/config.server.js from the build so `b2c mrt bundle deploy` reads the correct ssrOnly/ssrShared globs.
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.
What
Adds a new
/outbound-loopreference route to the MRT reference app. The handler (outboundLoopTest) makes an outbound request to the app's own storefront and returns the upstream response verbatim.EXTERNAL_DOMAIN_NAMEenv var (returns400if unset).https://only when the env var doesn't already include a scheme.?path=query param (defaults to/).x-mrt-loop: trueheader on the outbound request.Registered as
GET /outbound-loopinserver.ts.Why
Provides a reference endpoint for exercising outbound requests from the reference app back to its own external domain.
Also included
scripts/build.mjsnow emitsbuild/config.server.jssob2c mrt bundle deployreads the correctssrOnly/ssrSharedglobs (otherwise the streaming entry point lands in neither bucket and the push is rejected).Tests
Added coverage for
outboundLoopTest: missing-domain 400, verbatim pass-through, thex-mrt-loopheader, custom?path=, no double-scheme, and upstream status propagation. All 212 package tests pass; lint and typecheck are clean.