Socket
Socket
Sign inDemoInstall

cf-nodejs-client

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-nodejs-client

A Cloud Foundry Client for Node.js


Version published
Weekly downloads
46
increased by4.55%
Maintainers
1
Weekly downloads
 
Created
Source

cf-nodejs-client Build Status Dependency Status devDependency Status

NPM

Note: This package is not ready for a production App yet.

This project provides a simple client library to interact with the Cloud Foundry REST API using Node.js. The client provides objects to retrieve information about the following concepts:

  • Apps
  • BuildPacks
  • Domains
  • Jobs
  • Logs
  • Organizations
  • Routes
  • Service Bindings
  • Spaces
  • Stacks
  • User Provided Services

Applications

Node.js with Express are a great combination to develop Web applications. If you observe the Sinatra market, you will notice that the community goes in that address. This library could be useful for you to develop a Web Application to interact with a Cloud Foundry Instance.

The development doesn't cover the whole API. This library puts the focus in the Application life cycle to handle the following tasks:

  • Create an App
  • Upload zip with source code
  • Create an User Provided Services
  • Associate Apps with an User Provided Services
  • Start | Stop an App
  • Logs management
  • Scale Apps (Pending)
  • Remove Apps
  • Remove User Provided Services

Getting Started

If you need to interact with a Cloud Foundry platform, install the package in your Node.js development:

npm install cf-nodejs-client --save

Once you have installed the package define in a isolated config file the credentials to operate with the platform:

config.json

{
    "endpoint" : "https://api.run.pivotal.io",
    "username" : "xxx",
    "password" : "yyy"
}

With the credentials defined, create a new file to paste this code to authenticate with the platform.

example.js


"use strict";

var config = require('./config.json');//Load CF configuration

var CloudFoundry = require("cf-nodejs-client").CloudFoundry;
CloudFoundry = new CloudFoundry();
CloudFoundry.setEndPoint(config.endpoint);

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

Save the file and test:

node example.js

Testing

This project has a test suite to ensure the reability of this project. Take a look the Tests cases developed with Mocha & Chai to understand some stuff about Cloud Foundry and the usage of this client. Besides, the project has invested some amount of time in testing phase to be the code with a nice coverage level.

Test suite:

npm test

Code coverage:

istanbul cover node_modules/mocha/bin/_mocha -- -R spec

Continous integration:

https://travis-ci.org/jabrena/cf-nodejs-client/

Versions

Take a look this doc to check the evolution of this Client for Cloud foundry.

Issues

If you have any question or doubt, please create an issue.

Juan Antonio

Keywords

FAQs

Package last updated on 01 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc