Reputation: 497
I am building an app using firebase that needs to load an external webpage under an internal url i.e. when you go to myapp.com/edit it requests the content from someotherapp.com/edit and renders it in the browser without redirecting. I've tried using firebase hosting rewrites, but you can only rewrite to an internal url or a cloud function.
Upvotes: 10
Views: 1723
Reputation: 598668
What you're describing cannot be accomplished with rewrites, as those (as you say) can only rewrite to a location on the same server.
A redirect would allow you to redirect to a different server, but that new URL is then sent to the browser.
The only alternative option is to use Cloud Functions or Cloud Run to capture all requests, read from the remote server in that code, and then send that back to the client with a suitable caching interval.
Upvotes: 6