How do you I get the addr of host of one of my service from another service?
I have read the documentation about the BUILTIN environment variables and also the microservices but I still dont understand.
I have two services named service1 and service2, and service1 just do a basic http request to service2.
I have managed to set up internal ports correctly, I guess I then need to add environment variables myself.
But for the host when I go to one of the service environment variables I see this:
But I cant map the name service1 or service2, it seems like a generated id.
Great catch. You are right - the application ‘HOST’ environment variables use IDs instead of something more predictable, like application names.
At the moment we are discussing about making it more ‘developer friendly’. We may change the env vars to be built using application names instead of IDs.
For now, what you can do is to make aliases to the builtin variables. E.g, create a “MY_APP_A_HOST” environment variable that is an alias to the built-in variable. This way, your app can use a more predictable env variable name “MY_APP_A_HOST” instead.
Let me know if you need any help to create an env variable alias (or with any other issue).
Kind regards,
Patryk Jeziorowski
Software Engineer | Qovery
Backed by top-notch investors
Demo Day - Techcrunch