haibu-api

A collection of client wrappers for haibu's core api

npm install haibu-api
17 downloads in the last day
61 downloads in the last week
192 downloads in the last month

haibu-api (node.js)

The node.js client for the haibu API.

Usage

Allows you to call haibu programmatically from inside your node.js scripts.

var eyes = require('eyes'),
    haibu = require('haibu');

// Create a new client for communicating with the haibu server
var client = new haibu.drone.Client({
  host: 'localhost',
  port: 9002
});

// A basic package.json for a node.js application on haibu
var app = {
  "user": "marak",
  "name": "test",
  "domain": "devjitsu.com",
  "repository": {
    "type": "git",
    "url": "https://github.com/Marak/hellonode.git",
  },
  "scripts": {
    "start": "server.js"
  }
};

// Attempt to start up a new application
client.start(app, function (err, result) {
  if (err) {
    console.log('Error spawning app: ' + app.name);
    return eyes.inspect(err);
  }

  console.log('Successfully spawned app:');
  eyes.inspect(result);
});


client.start(app, function (err, result) {
  eyes.inspect(err);
  eyes.inspect(result);
});

Run Tests

All of the haibu tests are written in [vows][0], and cover all of the use cases described above.

  $ npm test

License: MIT

Author: Nodejitsu Inc

Contributors: Maciej Malecki, Charlie Robbins

npm loves you