Articles in this section

How to access services from my application?

This article has moved. Read the current version of How to access services from my application? on Upsun Support.

Services are accessible from your application through their relationships. An app gains access to a service if a relationship is created for it, and communication is done through that service's protocol.

For example, an app with a relationship to a MySQL service will be able to connect to the MySQL database service on port 3306 using the service's internal hostname. These service details can be read by querying the base64-encoded PLATFORM_RELATIONSHIPS environment variable, or by using a config reader helper module for the language your app is written in.

Here's an example command of how to read your relationships variable:

echo $PLATFORM_RELATIONSHIPS | base64 -d | json_pp

 

For more information on this feature, please see the following page in the Upsun documentation:

https://docs.upsun.com/add-services.html

Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Article is closed for comments.