This repository was archived by the owner on May 4, 2019. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork4
A local REST client for admin-on-rest
License
NotificationsYou must be signed in to change notification settings
marmelab/aor-json-rest-client
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
| Archived Repository This code is no longer maintained. Feel free to fork it, but use it at your own risks. |
For testing purpose withadmin-on-rest, use thejsonRestClient function that simply takes a JavaScript object, and serves as a regular REST client.
npm install aor-json-rest-client --save-dev
// in src/App.jsimportReactfrom'react';import{Admin,Resource}from'admin-on-rest';importjsonRestClientfrom'aor-json-rest-client';importdatafrom'./data';/** * data looks like: * { * posts: [ * { id: 0, title: 'Hello, world!' }, * { id: 1, title: 'FooBar' }, * ], * comments: [ * { id: 0, post_id: 0, author: 'John Doe', body: 'Sensational!' }, * { id: 1, post_id: 0, author: 'Jane Doe', body: 'I agree' }, * ], * } */import{PostList}from'./posts';constApp=()=>(<AdminrestClient={jsonRestClient(data,loggingEnabled=true)}><Resourcename="posts"list={PostList}/></Admin>);exportdefaultApp;
This REST client doesn't even use the HTTP transport - everything happens within the browser memory. That means that all changes are lost upon refresh. Do NOT use this client in production.
This library is licensed under theMIT Licence, and sponsored bymarmelab.
About
A local REST client for admin-on-rest
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.