-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidy up dynamodb schema and UI store (#59)
* Fix double fetch issue * Tidy dynamoDB schema * Tidy up album store * Update test
- Loading branch information
1 parent
ed653b0
commit 0d23920
Showing
25 changed files
with
562 additions
and
617 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { app } from './app.js'; | ||
import { uploadObject } from './controllers/helpers.js'; | ||
import { initialiseDynamodbTables } from './services/initialise-dynamodb-tables.js'; | ||
import S3Service from './services/s3-service.js'; | ||
|
||
try { | ||
const s3Service = new S3Service(); | ||
await initialiseDynamodbTables(); | ||
console.log('Finish verifying DynamoDB tables.'); | ||
|
||
const exists = await s3Service.checkObject({ Bucket: process.env.AWS_S3_BUCKET_NAME, Key: 'updateDatabaseAt.json' }); | ||
if (!exists) { | ||
console.log('updateDatabaseAt.json does not exist'); | ||
await uploadObject('updateDatabaseAt.json', JSON.stringify({ time: new Date().toISOString() })); | ||
} | ||
const s3Service = new S3Service(); | ||
|
||
await app.listen({ port: 3000 }); | ||
console.log('App is listening on port 3000.🚀🚀🚀'); | ||
} catch (err) { | ||
console.error(err); | ||
const exists = await s3Service.checkObject({ Bucket: process.env.AWS_S3_BUCKET_NAME, Key: 'updateDatabaseAt.json' }); | ||
if (!exists) { | ||
console.log('updateDatabaseAt.json does not exist'); | ||
await uploadObject('updateDatabaseAt.json', JSON.stringify({ time: new Date().toISOString() })); | ||
} | ||
|
||
await app.listen({ port: 3000 }); | ||
console.log('App is listening on port 3000.🚀🚀🚀'); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.