Access other apps URLs in multi app installation


I have a Yii2 installation with three running apps. An API, a backend and a frontend. This apps runs on three different servers: A dev server, a staging server and a production server. To avoid having to hardcode the urls and change them whenever we move a new commit to the next server I am looking for ways to access another apps base URL.

So basically in the Api app I’d like to know which BaseUrl the frontend App has. Is it, or or Or the backend? or stage-back?

Is this possible?