Comments (1)
Work around at the moment is to use a class similar to this:
const HOST = process.env.LOCAL_DDB_HOST || "localhost";
const PORT = process.env.LOCAL_DDB_PORT || 8000;
const ENDPOINT = process.env.LOCAL_DDB_ENDPOINT || `http://${HOST}:${PORT}`;
const OFFLINE_OPTIONS = {
region: "localhost",
endpoint: ENDPOINT,
accessKeyId: "MOCK_ACCESS_KEY_ID",
secretAccessKey: "MOCK_SECRET_ACCESS_KEY",
};
const IS_OFFLINE = process.env.IS_OFFLINE || process.env.IS_LOCAL;
class OfflineDynamoDB extends DynamoDBClient {
constructor(options: DynamoDBClientConfig) {
super({ ...options, ...OFFLINE_OPTIONS });
}
}
export const DynamoDB = IS_OFFLINE ? OfflineDynamoDB : DynamoDBClient;```
This is a breaking change to your code that uses this library though.
from serverless-dynamodb-client.
Related Issues (10)
- process.env.IS_OFFLINE is always undefined
- TypeError: Plugin is not a constructor HOT 5
- Allow to use custom options HOT 1
- Feature request: port override
- IS_OFFLINE has been removed HOT 3
- Add CODE_OF_CONDUCT.md
- Add CONTRIBUTING.md
- Make sure this module supports typescript
- Moving `aws-sdk` to `devDependencies`?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-dynamodb-client.