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:
- api_token: from your account or the Scalingo CLI, generate or get your Scalingo API token
- api_endpoint: from the API documentation site, get your targeted region endpoint:
- Agora: https://api.agora-fr1.scalingo.com/v1
- Outscale: https://api.osc-fr1.scalingo.com/v1
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 = ; const API_TOKEN = '<your_api_token>'; // Enter your own API tokenconst API_ENDPOINT = 'https://api.osc-fr1.scalingo.com/v1'; // ex: for Outscale region const scalingoApi = API_TOKEN API_ENDPOINT; scalingoApiapps;
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 = ; const API_TOKEN = '<your_api_token>'; // Enter your own API tokenconst API_ENDPOINT = 'https://api.osc-fr1.scalingo.com/v1'; // ex: for Outscale region const scalingoClient = API_TOKEN API_ENDPOINT; scalingoClient;
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.