node-scalingo
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

node-scalingo

This library is an out-of-the-box HTTP client for the Scalingo API in Node.js.

You can find the detailed Scalingo API specifications on the official API documentation website.

Getting started

1/ Get the following information from Scalingo:

2/ Install the dependency

npm install node-scalingo --save

3/ In your code, define a new ScalingoApi object. Then use the services you need.

const { ScalingoApi } = require('node-scalingo');
 
const API_TOKEN = '<your_api_token>'; // Enter your own API token
const API_ENDPOINT = 'https://api.osc-fr1.scalingo.com/v1';  // ex: for Outscale region
 
const scalingoApi = new ScalingoApi(API_TOKEN, API_ENDPOINT);
 
scalingoApi.apps.listApplications().then(console.log);

Usage

It is recommended to consume services through ScalingoApi.

If you miss a service - this library is still in construction (feb. 2020) -, you can still use ScalingoClient and the query() method, according to the Scalingo developers documentation.

The following example do the same as previously, but with ScalingoClient instead of ScalingoApi.

const { ScalingoClient } = require('node-scalingo');
 
const API_TOKEN = '<your_api_token>'; // Enter your own API token
const API_ENDPOINT = 'https://api.osc-fr1.scalingo.com/v1';  // ex: for Outscale region
 
const scalingoClient = new ScalingoClient(API_TOKEN, API_ENDPOINT);
 
scalingoClient.query('apps', 'get').then((response) => console.log(response.data));

Documentation

Please refer to the Scalingo API guides for help using node-scalingo.

Contributing

Installation

git clone git@github.com:jbuget/node-scalingo.git
cd node-scalingo
npm install
npm run build
npm test

Publishing

npm run release

License

This project is licensed under the AGPL-3.0 License.

Readme

Keywords

Package Sidebar

Install

npm i node-scalingo

Weekly Downloads

0

Version

0.3.0

License

AGPL-3.0

Unpacked Size

77.5 kB

Total Files

36

Last publish

Collaborators

  • jbuget