@mosure/host-panel-db-connector
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Database Connector for Host-Panel

To install @mosure/host-panel-db-connector.

Using the Connector

Note, setting the appropriate endpoint/region via AWS.config... is required before using connector components.

Testing

Run unit tests with npm run test.

Integration Testing with AWS DynamoDB

Run a local DynamoDB docker image via: docker run -p 8000:8000 amazon/dynamodb-local

Run integration tests (requires AWS DynamoDB endpoint, default is localhost) with npm run integration -- --endpoint http://localhost:8000.

Games Connector

Get:

const gamesConnector = new GamesConnector();

gamesConnector.get({
    id: 'GAME0'
})
.subscribe((game: Game) => {
    // TODO: Use the game
});

Put:

const gamesConnector = new GamesConnector();

gamesConnector.put({
    id: 'GAME2',
})
.subscribe((valid: boolean) => {
    // TODO: Use the result
});

Update:

const gamesConnector = new GamesConnector();

gamesConnector.update({
    id: 'GAME2',
    name: 'New Name',
})
.subscribe((valid: boolean) => {
    // TODO: Use the result
});

Delete:

const gamesConnector = new GamesConnector();

gamesConnector.delete({
    id: 'GAME2',
})
.subscribe((valid: boolean) => {
    // TODO: Use the result
});

Readme

Keywords

none

Package Sidebar

Install

npm i @mosure/host-panel-db-connector

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

38.6 kB

Total Files

37

Last publish

Collaborators

  • mosure