move files around
This commit is contained in:
13
services/db/dynamoClient.js
Normal file
13
services/db/dynamoClient.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const AWS = require('aws-sdk');
|
||||
|
||||
// Set the region
|
||||
AWS.config.update({region: 'us-east-2'});
|
||||
|
||||
// also set local endpoint while in development
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
AWS.config.update({endpoint: "http://localhost:8000"});
|
||||
}
|
||||
|
||||
const client = new AWS.DynamoDB.DocumentClient({});
|
||||
|
||||
module.exports = client;
|
||||
@@ -1,4 +1,4 @@
|
||||
const dynamoClient = require('../dynamoClient');
|
||||
const dynamoClient = require('./dynamoClient');
|
||||
|
||||
const create = async (tableName, item) => {
|
||||
const fullItem = {...item, created_at: Date.now()};
|
||||
Reference in New Issue
Block a user