0.0.2 • Published 7 years ago

repodb-client v0.0.2

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
7 years ago

RepoDB client

Introduction

RepoDB is a REST / GraphQL API allowing you to dynamically manage documents with specified models. This JavaScript client allows you to easily communicate with your RepoDB server with NodeJS or browsers.

Installation

npm install repodb-client --save

Browsers : Just include /node_modules/repodb-client/dist/repodb.js, and RepoDBClient will be accessible in global scope (in window variable).

Code Samples

const RepoDBClient = require('repodb-client')

RepoDBClient.get('/me', {}, (ret) => {
    console.log(ret)    
})

// Handling multiple status codes
RepoDBClient.get('/me', {}, {
    200: (ret) => {
        console.log('Logged, here the details : ', ret)
    },
    any: (ret, errorMsg) => {
        console.log('An error occured : ' + errorMsg)
    }
})
0.0.2

7 years ago

0.0.1

7 years ago