Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
feature: setup dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
georgelima committed Dec 15, 2018
1 parent ed8b6b1 commit 1ec1719
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZEC_PRICE_API_KEY=
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ flow-coverage
build
.docz
coverage
flow-typed
flow-typed
.env
3 changes: 3 additions & 0 deletions config/electron.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import '@babel/polyfill';
import dotenv from 'dotenv';

import path from 'path';

Expand All @@ -16,6 +17,8 @@ import zcashLog from './daemon/logger';
import getZecPrice from '../services/zec-price';
import store from './electron-store';

dotenv.config();

let mainWindow: BrowserWindowType;
let updateAvailable: boolean = false;
let zcashDaemon;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"autoprefixer": "^9.3.1",
"connected-react-router": "^5.0.1",
"date-fns": "^1.30.1",
"dotenv": "^6.2.0",
"electron": "^3.0.10",
"electron-store": "^2.0.0",
"eres": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion services/zec-price.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Payload = {
export default (currencies: string[] = ['USD']): Promise<Payload> => new Promise((resolve, reject) => {
const ENDPOINT = `https://min-api.cryptocompare.com/data/price?fsym=ZEC&tsyms=${currencies.join(
',',
)}&api_key=b6162b068ff9f8fe2872070b791146b06d186e83d5e52e49dcaa42ef8d1d3875`;
)}&api_key=${String(process.env.ZEC_PRICE_API_KEY)}`;

const request = net.request(ENDPOINT);
request.on('response', (response) => {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4812,6 +4812,11 @@ dotenv@^6.0.0, dotenv@^6.1.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.1.0.tgz#9853b6ca98292acb7dec67a95018fa40bccff42c"
integrity sha512-/veDn2ztgRlB7gKmE3i9f6CmDIyXAy6d5nBq+whO9SLX+Zs1sXEgFLPi+aSuWqUuusMfbi84fT8j34fs1HaYUw==

dotenv@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"
integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==

duplexer2@~0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
Expand Down

0 comments on commit 1ec1719

Please sign in to comment.