Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1002 Bytes

README.md

File metadata and controls

52 lines (38 loc) · 1002 Bytes

aor-dynamodb-client

An admin-on-rest client for DynamoDb.

Installation

npm install aor-dynamodb-client --save

Usage

// in src/App.js
import React from 'react';
import { Admin, Resource } from 'admin-on-rest';
import { PostList } from './posts';
import { restClient } from 'aor-dynamodb-client';

const awsConfig = { //optional
	region: 'us-east-1'
};

const config = {
	tableName: 'some-table-name',
	key: 'id', // optional
}

const App = () => (
	<Admin restClient={restClient(config, awsConfig)} >
		<Resource name="posts" list={PostList} />
	</Admin>
);

export default App;

// in src/posts.js
import React from 'react';
import { List } from 'admin-on-rest';
import { Pagination } from 'aor-dynamodb-client';

export const PostList = (props) => (
	<List {...props} pagination={<Pagination />}>
		...
	</List>
);

License

This library is licensed under the MIT Licence.