Created
June 29, 2020 18:41
-
-
Save camin-mccluskey/8929fb27c318ab8a105ebaef82beb6b0 to your computer and use it in GitHub Desktop.
Using dynamodb-admin as a library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const {createServer} = require('dynamodb-admin'); | |
const dynamodb = new AWS.DynamoDB(); | |
const dynClient = new AWS.DynamoDB.DocumentClient({service: dynamodb}); | |
const app = createServer(dynamodb, dynClient); | |
const port = 8001; | |
const server = app.listen(port); | |
server.on('listening', () => { | |
const address = server.address(); | |
console.log(` listening on http://0.0.0.0:${address.port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment