Skip to content

Commit

Permalink
Merge pull request #47 from agility/dev
Browse files Browse the repository at this point in the history
Merging into master
  • Loading branch information
joelvarty authored Feb 3, 2020
2 parents b643db9 + e051eb5 commit 2e8fea4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agility/content-fetch",
"version": "0.8.0",
"version": "0.8.1",
"description": "JavaScript library for the Agility Fetch API (node and browser)",
"main": "dist/agility-content-fetch.node.js",
"scripts": {
Expand Down
27 changes: 15 additions & 12 deletions src/api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,22 @@ const defaultConfig = {
};

function buildEnvConfig() {
let env = process.env;
let envConfig = {};
if (env.hasOwnProperty('AGILITY_BASEURL')) {
envConfig.baseUrl = env.AGILITY_BASEURL;
}
if (env.hasOwnProperty('AGILITY_GUID')) {
envConfig.guid = env.AGILITY_GUID;
}
if (env.hasOwnProperty('AGILITY_APIKEY')) {
envConfig.apiKey = env.AGILITY_APIKEY;
}
if (env.hasOwnProperty('AGILITY_ISPREVIEW')){
envConfig.isPreview = env.AGILITY_ISPREVIEW;

if (process && process.env) {
let env = process.env;
if (env.hasOwnProperty('AGILITY_BASEURL')) {
envConfig.baseUrl = env.AGILITY_BASEURL;
}
if (env.hasOwnProperty('AGILITY_GUID')) {
envConfig.guid = env.AGILITY_GUID;
}
if (env.hasOwnProperty('AGILITY_APIKEY')) {
envConfig.apiKey = env.AGILITY_APIKEY;
}
if (env.hasOwnProperty('AGILITY_ISPREVIEW')){
envConfig.isPreview = env.AGILITY_ISPREVIEW;
}
}

return envConfig;
Expand Down

0 comments on commit 2e8fea4

Please sign in to comment.