index.js
1 let secret = {}; 2 try { 3 secret = require("./.secret.json"); 4 } catch (err) { 5 console.log("WARN: .secret.json file not available"); 6 } 7 8 const env = process.env; 9 10 /* some defaults cannot be known in advance */ 11 const config = { 12 /* Api */ 13 PORT: env.PORT || 4000, 14 RATE_LIMIT_TIME: env.RATE_LIMIT_TIME || 15, 15 RATE_LIMIT_MAX_REQ: env.RATE_LIMIT_MAX_REQ || 1, 16 /* Database */ 17 DB_CONNECTION: env.DB_CONNECTION || secret.DB_CONNECTION || null, 18 /* Blockchain */ 19 BLOCKCHAIN_CONNECTION_POINT: env.BLOCKCHAIN_CONNECTION_POINT || secret.BLOCKCHAIN_CONNECTION_POINT || "http://localhost:8545", 20 /* Email */ 21 SENDGRID_API_KEY: secret.SENDGRID_API_KEY, 22 /* Watcher */ 23 BLOCK_DELAY: 6, // [Recommended 6 ~80 secs...] this could be helpful to avoid reorgs 24 POLL_SLEEP: 30, // seconds 25 VALID_DAPPS: ['teller-network'] 26 }; 27 28 module.exports = config;