Skip to content

Commit a68179a

Browse files
committed
try 171222 v3
1 parent debf481 commit a68179a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.vscode/launch.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"CHANNEL_ACCESS_TOKEN": "CsR1tRMsaaMgQYEoi1J50Wi7W/EQyNUF8pZpdBlaIJu3PMEGCoiP62NAFcb4++fimhkXfWqAN2EV9mYy77No0JTSvTjS3Umyw8Z+4Bun85HWW8zfQ25YI93LKSHfWee0CE13U0nBh0Vv2sBNVKboDgdB04t89/1O/w1cDnyilFU=",
1414
"CHANNEL_SECRET": "58a42475f74073df54edda24cde00f50",
1515
"PORT": "8089",
16+
"POSTGRES_HOST": "localhost",
1617
},
1718
}
1819
]

poloniex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ module.exports = {
120120
if (pair.indexOf('_' + currency) === -1) {
121121
continue;
122122
}
123-
var price = currency.toUpperCase() + '->' + pair.replace(currency, '').toUpperCase() + ': ' + (Math.round(tickers[pair].last * 10000) / 10000);
123+
var price = currency.toUpperCase() + '->' + pair.replace('_' + currency, '').toUpperCase() + ': ' + (Math.round(tickers[pair].last * 10000) / 10000);
124124
if (response == undefined) {
125125
if (withTimestamp == true) {
126126
response = tickers[pair].updatetime.toISOString() + '\n' + price;

postgres.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ const initOptions = {
44
};
55
const pgp = require('pg-promise')(initOptions);
66
const config = {
7-
host: 'postgres-db',
7+
// In production environment, host name is postgres container name from docker run or yml file
8+
// In developer environment, host name needs to defined in env variables or launch.json
9+
host: process.env.POSTGRES_HOST || 'postgres-db',
810
port: 5432,
911
database: 'example_database',
1012
user: 'postgres',
1113
password: 'example'
1214
};
13-
const pgUri = 'postgres://postgres:example@postgres-db:5432/example_database';
15+
//const pgUri = 'postgres://postgres:example@postgres-db:5432/example_database';
1416

1517
const db = pgp(config);
1618

0 commit comments

Comments
 (0)