'Able to proxy my React app in localhost to heroku server but not on firebase

I was wondering if there was a way to proxy my firebase-deployed app to redirect all requests to a heroku API URL.

{
  "name": "denrol",
  "version": "0.1.0",
  "private": true,
  "proxy": "https://kareemapp.herokuapp.com",
   ...
}

my React app package.json looks something like this and it works fine in localhost. However when I deploy it to firebase. It automatically reconfigures to direct requests to

https://kareemsapp.web.app

which is the firebase hosting default url

is there a way to configure firebase to proxy from the correct URL?

if relevant, this is what my firebase.json looks like

{
  "hosting": {
    "public": "build",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}



Solution 1:[1]

Ended up deploying frontend and backend to heroku, much better in terms of latency and security. Not a direct fix but much better than a hack-y workaround.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kareem Etefy