|
|
@ -5,12 +5,7 @@ export const EXPORTED_PATH = path.join(__dirname, '../exported'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getApiKey(host) { |
|
|
|
export function getApiKey(host) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
let data = fs.readFileSync(path.join(__dirname, '../api-keys.json'), 'utf8'); |
|
|
|
fs.readFile(path.join(__dirname, '../api-keys.json'), 'utf8', (err, data) => { |
|
|
|
|
|
|
|
if(err) { |
|
|
|
return JSON.parse(data)[host] |
|
|
|
reject(err); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
resolve(JSON.parse(data)[host]); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|