1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-14 15:20:06 +02:00
copilot/legacy/cloudapi-graphql/src/credentials.js
Sérgio Ramos 8295bd6882 chore: initial lerna setup
this shall be a progressive process
2017-05-25 10:56:50 +01:00

28 lines
614 B
JavaScript

const json = (() => {
try {
const res = require('dotenv').config({
path: '../.env',
silent: true
});
if (res.error) {
throw res.error;
}
} catch (err) {
try {
return require('../credentials.json');
} catch (err) {
return {};
}
}
return {};
})();
module.exports = {
url: process.env.SDC_URL || json.SDC_URL || json.url || '',
account: process.env.SDC_ACCOUNT || json.SDC_ACCOUNT || json.account || '',
user: process.env.SDC_USER || json.SDC_USER || json.user || '',
keyId: process.env.SDC_KEY_ID || json.SDC_KEY_ID || json.keyId || ''
};