EndlessVanguard / bitcoin-remunerate-api

A scheme for trustless, decentralized, anonymous, remuneration for content creators.
1 stars 0 forks source link

config file #40

Closed mattgstevens closed 8 years ago

mattgstevens commented 8 years ago

im a fan of using "dotenv" to load a .env file that holds secrets & configs that should not be checked into the repo.

a first pass of things we might want: DATABASE_URL=postgres://username>:<password>@localhost:5432/<db_name LOG_LEVEL=debug NODE_ENV=development PORT=5000 REDIS_URL=redis://:@localhost:6379 TZ=UTC

fromheten commented 8 years ago

I see why this can be a solution to a problem, but do we have the problem or is this just adding one more thing to keep in your head when coding? So far we

Another way to archive the same thing could be to use arguments to the app, that are loaded with ARGV. We could even let the argument be a JSON data structure, so we can just pass in a map of initialization data. That would fit with our functional way, as opposed to writing into the enviroment key/value thingy and reading from there. So instead of $ LOG_LEVEL=debug node my-app.js, it would be $ node my-app.js --logLevel debug.

In conclusion, I think we should close this ticket since it is a solution to a problem we are not experiencing. What do you think?

mattgstevens commented 8 years ago

ok I reached for my template and extracted things I thought were relevant.

What lead me here is the TZ env var, as this should be set so our Dates are normalized. Taking a second pass on the code base and we only use Date.now() which means we won't have this problem (new Date() may not be UTC)