JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q53508F
  • License MIT

A Cloud Foundry Client for Node.js

Package Exports

  • cf-nodejs-client

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cf-nodejs-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cf-nodejs-client [Alpha]

A Cloud Foundry Client for Node.js

Build Status

Note: Not use this library in a production App.

This project try to provide a library to interact with Cloud Foundry REST API. http://apidocs.cloudfoundry.org/213/

Currently, Pivotal offer the following clients:

https://github.com/cloudfoundry/cli

https://github.com/cloudfoundry/cf-java-client

The library uses Promises.

https://promisesaplus.com/

https://strongloop.com/strongblog/promises-in-node-js-with-q-an-alternative-to-callbacks/

Usage

/*jslint node: true*/
/*global describe: true, it: true*/
"use strict";

var config = require('./config.json');
var cloudFoundry = require("cf-nodejs-client").CloudFoundry;
cloudFoundry = new cloudFoundry(config.CF_API_URL);

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

var token_endpoint = null;

cloudFoundry.getInfo().then(function (result) {
    token_endpoint = result.token_endpoint;	
    return cloudFoundry.login(token_endpoint,config.username,config.password);
}).then(function (result) {
    console.log(result);   
}).catch(function (reason) {
    console.error("Error: " + reason);
});