Skip to content

Commit

Permalink
fixed store config in case no endpoint is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-viegas committed Jul 17, 2019
1 parent 5020915 commit f71950d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@jtviegas/store-functions",
"version": "0.0.3",
"version": "0.0.4",
"description": "functions for a data store api",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 7 additions & 2 deletions service.js
Expand Up @@ -8,8 +8,13 @@ const service_module = (config) => {
logger.info("...initializing service module...");
const common = require("./common")(config);

store.init({ apiVersion: config.DB_API_VERSION , region: config.DB_API_REGION , endpoint: config.DB_ENDPOINT
, accessKeyId: config.DB_API_ACCESS_KEY_ID , secretAccessKey: config.DB_API_ACCESS_KEY } );
let storeConfig = { apiVersion: config.DB_API_VERSION , region: config.DB_API_REGION
, accessKeyId: config.DB_API_ACCESS_KEY_ID , secretAccessKey: config.DB_API_ACCESS_KEY };

if( config.DB_ENDPOINT )
storeConfig['endpoint'] = config.DB_ENDPOINT;

store.init( storeConfig );
logger.info("...initialized the store successfully !");

var confirmTable = (table, callback) => {
Expand Down

0 comments on commit f71950d

Please sign in to comment.