Skip to content

Commit e1ef0c6

Browse files
authored
feat: add .env support to the node (#336)
1 parent 3eb1d44 commit e1ef0c6

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ yarn-error.log
2323

2424
# OS specific files
2525
.DS_Store
26+
27+
# local environment variables
28+
.env

packages/request-node/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@requestnetwork/ethereum-storage": "0.1.1-alpha.9",
4343
"@requestnetwork/types": "0.1.1-alpha.8",
4444
"cors": "2.8.5",
45+
"dotenv": "8.0.0",
4546
"express": "4.16.4",
4647
"http-status-codes": "1.3.0",
4748
"truffle-hdwallet-provider": "1.0.3",

packages/request-node/src/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { Storage as StorageTypes } from '@requestnetwork/types';
22
import { argv } from 'yargs';
33

4+
// Load environment variables from .env file (without overriding variables already set)
5+
require('dotenv').config();
6+
47
/**
58
* This contains default values used for the server and storage initialization
69
* when environment variable is not specified

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,6 +3104,11 @@ dot@^1.1.1:
31043104
resolved "https://registry.yarnpkg.com/dot/-/dot-1.1.2.tgz#c7377019fc4e550798928b2b9afeb66abfa1f2f9"
31053105
integrity sha1-xzdwGfxOVQeYkosrmv62ar+h8vk=
31063106

3107+
dotenv@8.0.0:
3108+
version "8.0.0"
3109+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.0.0.tgz#ed310c165b4e8a97bb745b0a9d99c31bda566440"
3110+
integrity sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg==
3111+
31073112
drbg.js@^1.0.1:
31083113
version "1.0.1"
31093114
resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b"

0 commit comments

Comments
 (0)