Skip to content

Commit

Permalink
Merge pull request #393 from blockchain/feature/update-webpack-logger
Browse files Browse the repository at this point in the history
Missing pieces for new WebSocket URIs
  • Loading branch information
plondon authored May 8, 2018
2 parents 893e050 + 5b05969 commit b85dfcf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/blockchain/blockchain-wallet-v4-frontend.svg?branch=master)](https://travis-ci.org/blockchain/blockchain-wallet-v4-frontend)
[![Coverage Status](https://coveralls.io/repos/github/blockchain/blockchain-wallet-v4-frontend/badge.svg)](https://coveralls.io/github/blockchain/blockchain-wallet-v4-frontend)
[![Coverage Status](https://coveralls.io/repos/github/blockchain/blockchain-wallet-v4-frontend/badge.svg?branch=development)](https://coveralls.io/github/blockchain/blockchain-wallet-v4-frontend?branch=development)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)

# Blockchain Wallet v4
Expand Down
4 changes: 3 additions & 1 deletion packages/blockchain-wallet-v4-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ if (!isCiBuild) {
console.log(chalk.cyan('Root URL') + `: ${envConfig.ROOT_URL}`)
console.log(chalk.cyan('API Domain') + `: ${envConfig.API_DOMAIN}`)
console.log(chalk.cyan('Wallet Helper Domain') + ': ' + chalk.blue(envConfig.WALLET_HELPER_DOMAIN))
console.log(chalk.cyan('Web Socket URL') + ': ' + chalk.blue(envConfig.WEB_SOCKET_URL) + '\n')
console.log(chalk.cyan('BTC Web Socket URL') + ': ' + chalk.blue(envConfig.BTC_WEB_SOCKET_URL))
console.log(chalk.cyan('BCH Web Socket URL') + ': ' + chalk.blue(envConfig.BCH_WEB_SOCKET_URL))
console.log(chalk.cyan('ETH Web Socket URL') + ': ' + chalk.blue(envConfig.ETH_WEB_SOCKET_URL) + '\n')
}
}

Expand Down
33 changes: 17 additions & 16 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@
const express = require('express')
const compression = require('compression')
const path = require('path')

let isLocal
let localWalletOptions
let environment
let rootURL
let webSocketURL
let apiDomain
let walletHelperDomain
let isLocal, localWalletOptions, environment, rootURL, apiDomain, walletHelperDomain, webSocketBtcURL, webSocketEthURL, webSocketBchURL

// store configs and build server configuration
if (process.env.LOCAL_PROD) {
Expand All @@ -22,20 +15,26 @@ if (process.env.LOCAL_PROD) {
isLocal = true
environment = 'local prod'
rootURL = prodConfig.ROOT_URL
webSocketURL = prodConfig.BTC_WEB_SOCKET_URL
webSocketBtcURL = prodConfig.BTC_WEB_SOCKET_URL
webSocketBchURL = prodConfig.BCH_WEB_SOCKET_URL
webSocketEthURL = prodConfig.ETH_WEB_SOCKET_URL
apiDomain = prodConfig.API_DOMAIN
walletHelperDomain = prodConfig.WALLET_HELPER_DOMAIN
localWalletOptions.domains = {
'root': prodConfig.ROOT_URL,
'api': prodConfig.API_DOMAIN,
'btcSocket': prodConfig.BTC_WEB_SOCKET_URL,
'walletHelper': prodConfig.WALLET_HELPER_DOMAIN
'root': rootURL,
'api': apiDomain,
'btcSocket': webSocketBtcURL,
'bchSocket': webSocketBchURL,
'ethSocket': webSocketEthURL,
'walletHelper': walletHelperDomain
}
} else {
// production config
environment = process.env.ENVIRONMENT
rootURL = process.env.ROOT_URL
webSocketURL = process.env.BTC_WEB_SOCKET_URL
webSocketBtcURL = process.env.BTC_WEB_SOCKET_URL
webSocketBchURL = process.env.BCH_WEB_SOCKET_URL
webSocketEthURL = process.env.ETH_WEB_SOCKET_URL
apiDomain = process.env.API_DOMAIN
walletHelperDomain = process.env.WALLET_HELPER_DOMAIN
}
Expand All @@ -49,13 +48,15 @@ console.log('\n** Configuration **')
console.log(`Environment: ${environment}`)
console.log(`Listening Port: ${port}`)
console.log(`Root URL: ${rootURL}`)
console.log(`Web Socket URL: ${webSocketURL}`)
console.log(`BTC Web Socket URL: ${webSocketBtcURL}`)
console.log(`BCH Web Socket URL: ${webSocketBchURL}`)
console.log(`ETH Web Socket URL: ${webSocketEthURL}`)
console.log(`API Domain: ${apiDomain}`)
console.log(`Wallet Helper Domain: ${walletHelperDomain}`)
console.log(`iSignThis Domain: ${iSignThisDomain}\n`)

// validate env configs are given
if (!port || !rootURL || !webSocketURL || !apiDomain || !walletHelperDomain) {
if (!port || !rootURL || !webSocketEthURL || !webSocketBchURL || !webSocketBtcURL || !apiDomain || !walletHelperDomain) {
throw new Error('One or more required environment variables are undefined!')
}

Expand Down

0 comments on commit b85dfcf

Please sign in to comment.