@marcelbraun/enapso-api
v1.0.0
Published
Enapso REST API
Downloads
2
Readme
enapso-api
Enapso REST API
Create
{
"meta": {
"schema": "Test",
"cls": "Test"
},
"records": [
{
"rid": 1,
"text": "This is a new record!"
}
]
}
In case of success: { "status": 200, "op": "create", "count": 1, "message": "ok", "success": true }
Sencha Settings
Read
To read individuals from the api, your application needs to pass the schema
and the class
.
Th read the data in pages, you optionally can pass an offset
and a limit
parameter.
{
"meta": {
"schema": "Test",
"cls": "Test",
"offset": 0,
"limit": 2
}
}
Update
Delete
Sencha Settings
Proxy
paramsAsJson: true idParam: _id startParam: offset (instead of skip)
actionMethods: { "create": "POST", "read": "POST", "update": "POST", "destroy": "POST" } headers: { "Content-Type": "application/json" } api: { read: 'http://localhost:3000/read', update: 'http://localhost:300/update', create: 'http://localhost:300/create', destroy: 'http://localhost:3000/delete' } extraParams: { "meta": { "schema": "Test", "cls": "Test" } }
Reader
rootProperty: 'records'
Writer
rootProperty: 'records'