1.0.3 • Published 12 months ago

cf-connect v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

Cloud Foundry NodeJS Client

This package is intended to be installed and used to let users connect to their apps deployed in Cloud Foundry.

Installation

npm i cf-connect

Usage

Login to your PCF Environment

const UsersUAAController = new (require('cf-connect').UsersUAA);

function setEndPoint(req, res, next) {
            UsersUAAController.setEndPoint('https://api.your.pcf.authorization.endpoint');
}

function userPCFLogin(username, password) {
        UsersUAAController.login(username, password)
                    .then((result) => {
                        resolve(result)
                    })
                    .catch((err) => {
                        reject(err)
                    })
}
const AppsController = new (require('cf-connect').Apps);

function setToken(req, res, next) {
            AppsController.setToken(req.pcfAuthResult);
            AppsController.API_URL = req.body.url;
}

// To get certain App details
function getAppDetails(req, res, next) {
            AppsController.getApp(req.query.appGuid)
            .then((result) => {
                    // your logic here
                }).catch((reason) => {
                    // some awesome error handling here
                });
}
1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago