28.io-nodejs
Version:
Node.js bindings for the 28.io API
38 lines (31 loc) • 1.5 kB
Markdown
#28.io Nodejs Binding
[](https://travis-ci.org/28msec/28.io-nodejs) [](http://badge.fury.io/js/28.io-nodejs) [](https://codeclimate.com/github/28msec/28.io-nodejs)
28.io-nodejs is an officially supported nodejs binding for [28.io](http://28.io).
28.io is a query processing platform that allows you to write complex queries accross multiple data sources - relational databases; document stores, data warehouses and even web services.
We also have [tutorials](http://www.28.io/blog/tags/tutorial) and an
[REST API reference](http://www.28.io/documentation/latest/api).
Join our [28.io Support Group](https://28msec.zendesk.com) to ask questions and provide feedback.
##Installation
```bash
npm install 28.io-nodejs
```
##Example
```javascript
var $28 = require('api.28.io').$28('http://portal.28.io/api');
var projectName = 'apitests';
$28.Auth.authenticate({
email: 'w+test@28.io',
password: 'foobar',
grant_type: 'client_credentials'
})
.then(function(response){
var tokens = response.body;
var projectToken = project_tokens['project_' + projectName];
$28.Queries(projectname).listQueries({
visibility: 'private',
token: projectToken
})
.then(function(response){
console.log(response.body);
});
```