repodb-client
v0.0.2
Published
RepoDB JavaScript client, for NodeJS and browsers
Downloads
4
Readme
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 (inwindow
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)
}
})