Access other apps URLs in multi app installation

Hello,

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 dev.domain.de, or stage.domain.de or www.domain.de? Or the backend? dev-back.domain.de? or stage-back?

Is this possible?

Thanks,

thomas