You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 custom SpaEndpoint such that when the StaticFilesEndpoint 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. Furthermore Request does not impl Clone, 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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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