Skip to content

Commit e2308d3

Browse files
committed
Fix code
1 parent 0bebc47 commit e2308d3

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

sample.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ CLIENT_SECRET=xxx
1010
AWS_ACCESS_KEY_ID=xxx
1111
AWS_SECRET_ACCESS_KEY=xxx
1212
AWS_REGION=us-east-1
13-
# Set DYNAMODB_ENDPOINT to http://localhost:8000 for local DynamoDB
13+
# Set DYNAMODB_ENDPOINT_URL to http://localhost:8000 for local DynamoDB
1414
# Comment out or remove for AWS DynamoDB
15-
# DYNAMODB_ENDPOINT=http://localhost:8000
15+
# DYNAMODB_ENDPOINT_URL=http://localhost:8000
1616

1717
JWT_SECRET=xxx
1818
DYNAMO_TABLE_PREFIX=xxx

src/server/models/db.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import { Data, dataSchema } from './data-model'
88
import { Statics, staticsSchema } from './statics-model'
99

1010
// Configure DynamoDB
11-
if (process.env.DYNAMODB_ENDPOINT !== undefined) {
12-
dynamoose.aws.ddb.local(process.env.DYNAMODB_ENDPOINT)
11+
if (typeof process.env.DYNAMODB_ENDPOINT_URL === 'string' && process.env.DYNAMODB_ENDPOINT_URL.length > 0) {
12+
console.log('Using local DynamoDB at', process.env.DYNAMODB_ENDPOINT_URL)
13+
dynamoose.aws.ddb.local(process.env.DYNAMODB_ENDPOINT_URL)
1314
}
1415

1516
// Common schema options

0 commit comments

Comments
 (0)