Trancever / harperdb-connect

Node.JS module for connecting to HarperDB and simplifying HTTP requests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HarperDB Connect

Build Status

https://nodei.co/npm/harperdb-connect.png?downloads=true&downloadRank=true&stars=true

Developed by Ethan Arrowood

Potential use cases: (API will be designed to satisfy the following use patterns)

const db = new HarperDBConnect(
  'username', 
  'password', 
  'http://localhost:5000'
)

db
  .connect('http://localhost:5000')
  .then(host => console.log(`db connection to ${host} successful.`))
  .catch((err, host) => console.log(`db connection to ${host} unsuccesful.`))

db.setDefaultOptions({
  'method': 'POST',
  'headers': {
    'content-type': 'application/json'
  },
  'json': true
})

db
  .request({
    'operation': 'describe_all'
  }) 
  .then(res => console.log(`Database responded with: ${res}`))
  .catch(err => console.log(`Database request error: ${err}`))

This API is to be used with HarperDB Community Edition

About

Node.JS module for connecting to HarperDB and simplifying HTTP requests.

License:MIT License


Languages

Language:JavaScript 100.0%