0.0.3 • Published 7 years ago

dv-kay v0.0.3

Weekly downloads
4
License
Apache-2.0
Repository
-
Last release
7 years ago

devless-sdk

DevLess-SDK is a module that provides a host of functions for working with data from the DevLess Backend.

Inline docs npm version

Install

npm install devless-sdk --save

Usage

Require and initialize the module with your DevLess URL and Token.

const DevLess = require('devless-sdk');

const dv = new DevLess("DevLess_instance_URL", "DevLess_Token");

And you can now have access to all the methods exposed by the module. They include:

CRUD

Query (read) data from table

dv.queryData(serviceName, tableName, queryParams);

Add data to table

dv.addData(serviceName, tableName, data);

Update data in table

dv.updateData(serviceName, tableName, identifierField, identifierValue, data);

Delete data from table

dv.deleteData(serviceName, tableName, identifierField, identifierValue);

Authentication

For actions including signup and login.

dv.signup(params);
dv.login(params);

RPC

dv.call(serviceName, action, params, callback);

#Example const dv = new DevLess("http://my-devlessapp.herokuapp.com", "5a5d555d55ds5a5e45ss2")

And you can now have access to all the methods exposed by the module. They include:

#USING EXPRESS

```javascript
$ npm install express -s
```


```javascript
const express = require('express')

const app = express()


Creating Record 

dv.addData(serviceName, tableName, queryParams)
This will return a promise

Example

app.post('/', async(req, res)=>{
    let data = {
     name: "",
     description: "This is all night waakye for the students at Lancaster",
     location: "AnC Mall",
    }
    const resp =  await dv.addData('Events', 'event', data)

        #OR

    const resp = await dv.addData('Events', 'event', req.body)
})



 #### Creating Record 

dv.queryData(serviceName, tableName, queryParams)
This will return a promise

### Example 
app.post('/', async(req, res)=>{
    let data = {
     name: "",
     description: "This is all night waakye for the students at Lancaster",
     location: "AnC Mall",
    }
    const resp =  await dv.addData('Events', 'event', data)

        #OR

    const resp = await dv.addData('Events', 'event', req.body)
})


app.listen(3000, function(){
    console.log('Server started')
})
```

Note: This readme is a WIP. For more info on parameter definitions, etc, see the DevLess Documentation.

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago