Starting on working bookmarks api

This commit is contained in:
2022-06-27 09:01:36 -05:00
parent 4c37658cd8
commit 6fe79a1892
13 changed files with 652 additions and 58 deletions

12
web/lib/apiHelpers.js Normal file
View File

@@ -0,0 +1,12 @@
function withErrorHandling(handler) {
return async (req, res) => {
try {
await handler(req, res);
} catch (error) {
console.error(error);
res.status(error.status || 500).end(error.message);
}
};
}
export { withErrorHandling };

13
web/lib/db.js Normal file
View File

@@ -0,0 +1,13 @@
const AWS = require("aws-sdk");
AWS.config.update({
accessKeyId: process.env.FMN_AWS_ACCESS_KEY_ID, // Do NOT HARD-CODE your secret credentials here
secretAccessKey: process.env.FMN_AWS_SECRET_ACCESS_KEY, // Do NOT HARD-CODE your secret credentials here
region: process.env.FMN_AWS_REGION,
});
const dynamodb = new AWS.DynamoDB.DocumentClient({
region: process.env.FMN_AWS_REGION,
});
export default dynamodb;