cloudapi: fall back to .env file

This commit is contained in:
Tom Gallacher 2016-11-01 16:14:55 +00:00
parent 5c0d8e4601
commit adb0ffb476
3 changed files with 8 additions and 0 deletions

View File

@ -10,6 +10,7 @@
}, },
"dependencies": { "dependencies": {
"bunyan": "^1.8.1", "bunyan": "^1.8.1",
"dotenv": "^2.0.0",
"express": "^4.14.0", "express": "^4.14.0",
"express-graphql": "^0.5.4", "express-graphql": "^0.5.4",
"got": "^6.5.0", "got": "^6.5.0",

View File

@ -2,6 +2,9 @@ const json = (() => {
try { try {
return require('../credentials.json'); return require('../credentials.json');
} catch (err) { } catch (err) {
require('dotenv').config({
path: '../.env'
});
return {}; return {};
} }
})(); })();

View File

@ -1412,6 +1412,10 @@ dot-prop@^3.0.0:
dependencies: dependencies:
is-obj "^1.0.0" is-obj "^1.0.0"
dotenv:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-2.0.0.tgz#bd759c357aaa70365e01c96b7b0bec08a6e0d949"
dtrace-provider@^0.7.0, dtrace-provider@~0.7: dtrace-provider@^0.7.0, dtrace-provider@~0.7:
version "0.7.0" version "0.7.0"
resolved "https://registry.yarnpkg.com/dtrace-provider/-/dtrace-provider-0.7.0.tgz#9ac6d3eb78ffbe90385063e6d14dfe7bc377005d" resolved "https://registry.yarnpkg.com/dtrace-provider/-/dtrace-provider-0.7.0.tgz#9ac6d3eb78ffbe90385063e6d14dfe7bc377005d"