Returns PCF service credentials as an object of ENV formatted strings.
Given the service configuration:
{
"VCAP_SERVICES": {
"user-provided": [
{
"name": "db-service",
"credentials": {
"username": "db-username",
"password": "db-password"
}
}
],
"p-rabbitmq": [
{
"name": "message-broker",
"credentials": {
"username": "broker-username",
"password": "broker-password"
}
}
]
}
}
import { getPcfServiceCredentials } from "pcf-services-parser";
getPcfServiceCredentials();
// {
// DB_SERVICE_USERNAME: "db-username",
// DB_SERVICE_PASSWORD: "db-password",
// MESSAGE_BROKER_USERNAME: "broker-username",
// MESSAGE_BROKER_PASSWORD: "broker-password"
// };