How to wrap an endpoint with another endpoint #682
Unanswered
frenetisch-applaudierend
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background: I'm trying to serve a server side rendered SPA from a poem backend. For this I wanted to wrap the
StaticFilesEndpoint
with my customSpaEndpoint
such that when theStaticFilesEndpoint
fails to find a static asset at the given URL, I can fall back to loading and pre-rendering my SPA.The problem arises from the fact, that I cannot clone a request and the endpoint moves the request, therefore once the
StaticFilesEndpoint
has processed the request, I have no access to the request anymore. FurthermoreRequest
does not implClone
, so that is also not an option.Therefore my question: How can you wrap another endpoint, such that you can implement fallback logic. Or is there something I could do fundamentally different?
Beta Was this translation helpful? Give feedback.
All reactions