Skip to content

cloudControl/ngcclib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

ngCclib

ngCclib is an AngularJS wrapper for the cloudControl RESTful API. For more information about the cloudControl API, please check out this page.

Dependencies

  • AngularJS 1.2.x
  • AngularJS modules:
    • ngResource 1.2.x
  • angular-cache 1.2.x

The tests require Karma, Karma-PhantomJS-Launcher and Karma-Jasmine to be installed.

Download and install NodeJS, then run:

$ npm install

This will install Bower and call bower install, which in turn will install the desired dependencies.

Installation and Usage

The ngCclib module is meant to be used as a regular AngularJS module. Authentication relies on a API token. The cc_token object gets loaded from local storage and should be of the following format: {"token":"aAbBcC..."}.

(Note that the /token endpoint of the cloudControl API returns the appropriate object.)

The module also provides a configuration service which allows the user to change the URI of the API to the calls are to be made. The defaut URI is set to be https://api.cloudcontrol.com, but can be changed in the configuration phase of the initialisation.

angular.module('myApp').config(['configurationServiceProvider', function (configurationServiceProvider) {
    configurationServiceProvider.setApiUri('https://api.example.com');
}]);

The set API URI can then be accessed using configurationService.api_uri.

Tests

The /tests/app folder contains the unittests for ngCclib. Those are written using the Jasmine framework. The above mentionned folder follows a structure similar to the one of our source code.

The tests are run using Karma. To run the tests, type:

$ npm test

License

This library is distributed under the Apapche License.

About

AngularJS resources for the cloudControl API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors