ra-data-json-sails

2.0.0 • Public • Published

Sails.js API Data Provider For React-Admin

Sails.js API Data Provider for react-admin. Based on ra-data-json-server.

Installation

npm install --save mpampin/ra-data-json-sails

REST Dialect

REST verb API calls
GET_LIST GET http://my.api.url/posts?sort=title%20ASC&skip=0&limit=50&title=bar
GET_ONE GET http://my.api.url/posts/123
CREATE POST http://my.api.url/posts/123
UPDATE PUT http://my.api.url/posts/123
DELETE DELETE http://my.api.url/posts/123
GET_MANY GET http://my.api.url/posts/123, GET http://my.api.url/posts/456, GET http://my.api.url/posts/789
GET_MANY_REFERENCE GET http://my.api.url/posts?author_id=345

Note: The JSON Server REST Data Provider expects the API to include a X-Total-Count header in the response to GET_LIST calls. The value must be the total number of resources in the collection. This allows react-admin to know how many pages of resources there are in total, and build the pagination controls.

X-Total-Count: 319

If your API is on another domain as the JS code, you'll need to whitelist this header with an Access-Control-Expose-Headers CORS header.

Access-Control-Expose-Headers: X-Total-Count

Readme

Keywords

none

Package Sidebar

Install

npm i ra-data-json-sails

Weekly Downloads

0

Version

2.0.0

License

none

Unpacked Size

18.9 kB

Total Files

4

Last publish

Collaborators

  • mpampin