Skip to content

Instantly share code, notes, and snippets.

@azarboon
Created July 6, 2019 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azarboon/b029b43061c8a43f58e3a3be40d9e61c to your computer and use it in GitHub Desktop.
Save azarboon/b029b43061c8a43f58e3a3be40d9e61c to your computer and use it in GitHub Desktop.
const AWS = require('aws-sdk');
const App = require('./app.js');
const dynamoDb = new AWS.DynamoDB.DocumentClient({
apiVersion: '2012-08-10'
});
const app = new App(dynamoDb);
exports.readItem = async (event, context) => {
return app.readItem(event.queryStringParameters.id, context);
};
exports.createItem = async (event, context) => {
return app.createItem(JSON.parse(event.body), context);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment