How to change base URL at run time in ionic-v4?

Hi i am working with ionic 4 and i want to change base URL at run time. Actually i tried to change directly the base url in index.html file but i got some error like:

Error:Failed to load module script: The server responded with a non-JavaScript MIME type of “text/html”. Strict MIME type checking is enforced for module scripts per HTML spec.

Replaced by

Ionic forum expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you’ve tried, so as to illustrate a specific roadblock you’re running into in a minimal reproducible example. For more information, please see How to Ask and take the tour of the site.