From 574d9b418955bee7faa4234e824d95b231f86142 Mon Sep 17 00:00:00 2001 From: Bregwin Jogi Date: Fri, 26 Jul 2024 22:05:08 -0400 Subject: [PATCH] Corrected file paths for memory and s3 storage --- src/model/data/aws/index.js | 9 ++------- src/model/data/index.js | 5 +++++ src/model/fragment.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 src/model/data/index.js diff --git a/src/model/data/aws/index.js b/src/model/data/aws/index.js index d8b2a1e..787001e 100644 --- a/src/model/data/aws/index.js +++ b/src/model/data/aws/index.js @@ -1,12 +1,7 @@ -// src/model/data/index.js +// src/model/data/aws/index.js -// If the environment sets an AWS Region, we'll use AWS backend -// services (S3, DynamoDB); otherwise, we'll use an in-memory db. -module.exports = process.env.AWS_REGION ? require('./aws') : require('../memory'); +const logger = require('../../../logger'); -logger.info(`Using ${process.env.AWS_REGION ? 'AWS' : 'in-memory'} backend for data`); - -const logger = require('../../logger'); const s3Client = require('./s3Client'); const { PutObjectCommand, GetObjectCommand, DeleteObjectCommand } = require('@aws-sdk/client-s3'); diff --git a/src/model/data/index.js b/src/model/data/index.js new file mode 100644 index 0000000..1ed640e --- /dev/null +++ b/src/model/data/index.js @@ -0,0 +1,5 @@ +// src/model/data/index.js + +// If the environment sets an AWS Region, we'll use AWS backend +// services (S3, DynamoDB); otherwise, we'll use an in-memory db. +module.exports = process.env.AWS_REGION ? require('./aws') : require('./memory'); diff --git a/src/model/fragment.js b/src/model/fragment.js index ded3f57..bdf1438 100644 --- a/src/model/fragment.js +++ b/src/model/fragment.js @@ -12,7 +12,7 @@ const { writeFragmentData, listFragments, deleteFragment, -} = require('./data/aws'); +} = require('./data'); class Fragment { constructor({ id, ownerId, created, updated, type, size = 0 }) {